// Copyright (c) 2023 Alex Diener. All rights reserved.

#ifndef __EntityComponent_playerSteering_H__
#define __EntityComponent_playerSteering_H__

typedef struct EntityComponent_playerSteering EntityComponent_playerSteering;
#define EntityComponent_playerSteering_superclass EntityComponent_steering

#include "gamemath/ActionInput.h"
#include "gamemath/MoveInput.h"
#include "PROJECT_NAME/EntityComponent_steering.h"

#define EntityComponent_playerSteering_ivars \
	EntityComponent_steering_ivars \
	\
	MoveInputState moveInput; \
	ActionInputState actionInput; \
	MoveInput_axis lastMoveAxis;

#define EntityComponent_playerSteering_vtable(self_type) \
	EntityComponent_steering_vtable(self_type) \
	\
	bool (* startMoveInput)(self_type * self, MoveInput_axis axis, MoveInput_direction direction); \
	bool (* stopMoveInput)(self_type * self, MoveInput_axis axis, MoveInput_direction direction); \
	bool (* startActionInput)(self_type * self, ActionInput_action action); \
	bool (* stopActionInput)(self_type * self, ActionInput_action action); \
	void (* cancelAllMoveInputs)(self_type * self); \
	bool (* isTurnAdvancingInput)(self_type * self, MoveInput_axis axis, MoveInput_direction direction);

stemobject_declare(EntityComponent_playerSteering)

bool EntityComponent_playerSteering_init(EntityComponent_playerSteering * self);
void EntityComponent_playerSteering_dispose(EntityComponent_playerSteering * self);
void EntityComponent_playerSteering_initCopy(EntityComponent_playerSteering * self, compat_type(GameEntityComponent *) original);
Vector2i EntityComponent_playerSteering_getMoveVector(EntityComponent_playerSteering * self, struct GameEntity * entity);
bool EntityComponent_playerSteering_startMoveInput(EntityComponent_playerSteering * self, MoveInput_axis axis, MoveInput_direction direction);
bool EntityComponent_playerSteering_stopMoveInput(EntityComponent_playerSteering * self, MoveInput_axis axis, MoveInput_direction direction);
bool EntityComponent_playerSteering_startActionInput(EntityComponent_playerSteering * self, ActionInput_action action);
bool EntityComponent_playerSteering_stopActionInput(EntityComponent_playerSteering * self, ActionInput_action action);
void EntityComponent_playerSteering_cancelAllMoveInputs(EntityComponent_playerSteering * self);
bool EntityComponent_playerSteering_isTurnAdvancingInput(EntityComponent_playerSteering * self, MoveInput_axis axis, MoveInput_direction direction);

#endif
