#pragma once

#include "../../component/action/component_action_keep_in_rectangle.h"
#include "../../component/action/component_action_shoot.h"
#include "../../component/control/component_control_player.h"
#include "../../component/entity/component_character.h"
#include "../../component/stat/component_ammo.h"
#include "../../component/stat/component_game_entity_type.h"
#include "../../component/stat/component_goodies.h"
#include "../../component/stat/component_invincibility.h"
#include "../../component/stat/component_redirects.h"
#include "../../component/stat/component_stun.h"
#include "../../component/stat/component_upgrades.h"
#include "../../component/stat/component_heart.h"
#include "../../component/component_circle_collision.h"
#include "../../ecs_component.h"

#include "entity_snake.h"
#include "entity_player_health_display.h"
#include "entity_player_ammo_display.h"
#include "entity_player_redirect_display.h"

#define PLAYER_IS_SOLID false
#define PLAYER_IS_BOUNCE false
#define PLAYER_IS_AFFECTED_BY_GRAVITY false
#define PLAYER_CONTROL_MOVE_SPEED 1
#define PLAYER_FRICTION 0.875
#define PLAYER_VELOCITY_MAX 10
#define PLAYER_ACTION_SHOOT_SPEED 15
#define PLAYER_ACTION_SHOOT_HEIGHT 25.0f
#define PLAYER_ACTION_SHOOT_OFFSET 100.0f
#define PLAYER_CONTROL_SHOOT_COOLDOWN 12
#define PLAYER_CONTROL_REDIRECT_ANGLE_THRESHOLD 20 // Degrees
#define PLAYER_AMMO_START 1
#define PLAYER_HEALTH_MAX 3
#define PLAYER_REDIRECTS_START 1
#define PLAYER_GAME_ENTITY_TYPE GAME_ENTITY_PLAYER
#define PLAYER_ALLEGIANCE ALLEGIANCE_PLAYER
#define PLAYER_INVINCIBILITY_TIMER 120
#define PLAYER_STUN_TIMER 30
#define PLAYER_CIRCLE_RADIUS 75.0f

static const Rectangle PLAYER_ACTION_KEEP_IN_RECTANGLE =
{
	.x = 80,
	.y = 80,
	.w = 1820,
	.h = 930
};

static const ivec2 PLAYER_FRAME_SIZE = {512, 512};
static const ivec2 PLAYER_ATLAS_SIZE = {1, 1};
static const vec2 PLAYER_SIZE = {75.0f, 150.0f};
static const vec2 PLAYER_PHYSICS_SIZE = {60.0f, 20.0f};

void entity_player_init(ECS* ecs, u32 id, vec3 position, u32 spawnID);
