#pragma once

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

#include "component_ammo.h"
#include "component_redirects.h"
#include "../action/component_action_shoot.h"

#define COMPONENT_UPGRADES_LIFETIME_LEVEL_MULTIPLIER 5

#define UPGRADE_COUNT UPGRADE_LIFETIME + 1
typedef enum UpgradeType
{
	UPGRADE_AMMO,
	UPGRADE_REDIRECTS,
	UPGRADE_LIFETIME
} UpgradeType;

typedef struct ComponentUpgrades
{
	ECSComponent component;
	u32 currentLevels[UPGRADE_COUNT];
	u32 previousLevels[UPGRADE_COUNT];
} ComponentUpgrades;

static const u32 COMPONENT_UPGRADES_LEVELS_DEFAULT[UPGRADE_COUNT] =
{
	1,
	1,
	1
};

void component_upgrades_add(ComponentUpgrades* self, ECS* ecs);
void component_upgrades_tick(ComponentUpgrades* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_UPGRADES_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			(ECSFunction)component_upgrades_add,
			NULL, 
			(ECSFunction)component_upgrades_tick,
			NULL
		}
	},
	.type = ECS_COMPONENT_UPGRADES,
	.size = sizeof(ComponentUpgrades)
};


