#pragma once

#include "../../../GAME_COMMON.h"
#include "../../../input/input.h"
#include "../../../../engine/circle.h"
#include "../../ecs_entity.h"

#include "../component_physics.h"
#include "component_action_return.h"
#include "component_action_delete_on_touch_entity.h"
#include "../stat/component_redirects.h"

#include "../../entity/play/entity_redirect_arrow.h"

typedef struct ComponentActionLock
{
	ECSComponent component;
	u32 cooldown;
	u32 cooldownMax;
	u32 sender;
	u32 redirectArrowID;
	vec3 velocity;
	f32 selectRadius;
	f32 angle;
	bool isLock;
	bool isLocked;
	bool isSelected;
	bool isRedirectAngleGiven;
	bool isRedirectArrowInit;
} ComponentActionLock;

void component_action_lock_init(ComponentActionLock* self, u32 cooldown, f32 selectRadius, u32 sender);
void component_action_lock_tick(ComponentActionLock* self, ECS* ecs);
void component_action_lock_lock(ComponentActionLock* self, ECS* ecs);
void component_action_lock_unlock(ComponentActionLock* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_ACTION_LOCK_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			NULL,
			NULL,
			(ECSFunction)component_action_lock_tick,
			NULL
		}
	},
	.type = ECS_COMPONENT_ACTION_LOCK,
	.size = sizeof(ComponentActionLock)
};


