#pragma once

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

#include "../component_game_object.h"
#include "component_action_redirect.h"
#include "component_action_return.h"

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

typedef void (*ProjectileInit)(ECS*, u32, vec3, u32);

typedef struct ComponentActionShoot
{
	ECSComponent component;
	ProjectileInit projectileInit;
	f32 offset;
	f32 speed;
	f32 baseSpeed;
	f32 height;
	u32 redirectArrowID;
	u32 lifetimeBonus;
	bool isFire;
	bool isRedirectArrow;
} ComponentActionShoot;

void component_action_shoot_init
(
	ComponentActionShoot* self, 
	ProjectileInit projectileInit, 
	f32 speed, 
	f32 offset,
	f32 height
);

void component_action_shoot_tick(ComponentActionShoot* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_ACTION_SHOOT_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			NULL,
			NULL, 
			(ECSFunction)component_action_shoot_tick,
			NULL
		}
	},
	.type = ECS_COMPONENT_ACTION_SHOOT,
	.size = sizeof(ComponentActionShoot)
};


