#pragma once

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

#include "component_action_spawn.h"
#include "../stat/component_game_entity_type.h"

#define COMPONENT_ACTION_WAVE_COUNT 3

static const GameEntityType WAVE_ONE_ENEMIES[1] = { GAME_ENTITY_CRUMBLER };
static const GameEntityType WAVE_TWO_ENEMIES[1] = { GAME_ENTITY_CRUMBLER };
static const GameEntityType WAVE_THREE_ENEMIES[1] = { GAME_ENTITY_CRUMBLER };

static const SpawnWave SPAWN_WAVES[COMPONENT_ACTION_WAVE_COUNT] =
{
	{
		.types = (GameEntityType*)WAVE_ONE_ENEMIES,
		.typeCount = 1,
		.timer = 600
	},
	{
		.types = (GameEntityType*)WAVE_TWO_ENEMIES,
		.typeCount = 1,
		.timer = 600
	},
	{
		.types = (GameEntityType*)WAVE_THREE_ENEMIES,
		.typeCount = 1,
		.timer = 600
	},
};

typedef struct ComponentActionWave
{
	ECSComponent component;
	u32 timer;
	u32 index;
	bool isSpawnWave;
} ComponentActionWave;

void component_action_wave_add(ComponentActionWave* self, ECS* ecs);
void component_action_wave_tick(ComponentActionWave* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_ACTION_WAVE_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			(ECSFunction)component_action_wave_add,
			NULL,
			(ECSFunction)component_action_wave_tick,
			NULL
		}
	},
	.type = ECS_COMPONENT_ACTION_WAVE,
	.size = sizeof(ComponentActionWave)
};


