#pragma once

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

#include "../component_physics.h"
#include "../stat/component_stun.h"

typedef struct ComponentControlMove
{
	ECSComponent component;
	f32 speed;
	Direction direction;
	bool directionInput[DIRECTION_COUNT];
	bool previousDirectionInput[DIRECTION_COUNT];
} ComponentControlMove;

void component_control_move_init(ComponentControlMove* self, f32 speed);
void component_control_move_tick(ComponentControlMove* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_CONTROL_MOVE_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			NULL,
			NULL, 
			(ECSFunction)component_control_move_tick,
			NULL
		}
	},
	.type = ECS_COMPONENT_CONTROL_MOVE,
	.size = sizeof(ComponentControlMove)
};
