#pragma once

#include "../../../GAME_COMMON.h"
#include "../../ecs_entity.h"

#include "../component_physics.h"
#include "component_action_delete_on_touch_entity.h"
#include "component_action_damage.h"

typedef struct ComponentActionReturn
{
	ECSComponent component;
	f32 speed;
	f32 multiplier;
	f32 velocityMax;
	u32 lifetimeMax;
	u32 lifetime;
	u32 senderID;
	u32 timer;
	bool isReturning;
} ComponentActionReturn;

void component_action_return_init
(
	ComponentActionReturn* self, 
	ECS* ecs, 
	f32 speed,
	f32 multiplier,
	f32 velocityMax, 
	u32 lifetime, 
	u32 senderID
);
void component_action_return_add(ComponentActionReturn* self, ECS* ecs);
void component_action_return_delete(ComponentActionReturn* self, ECS* ecs);
void component_action_return_tick(ComponentActionReturn* self, ECS* ecs);
void component_action_return(ComponentActionReturn* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_ACTION_RETURN_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			(ECSFunction)component_action_return_add,
			(ECSFunction)component_action_return_delete,
			(ECSFunction)component_action_return_tick,
			NULL
		}
	},
	.type = ECS_COMPONENT_ACTION_RETURN,
	.size = sizeof(ComponentActionReturn)
};


