#include "entity_spawner.h"

/* Initializes a spawner entity. */
void
entity_spawner_init(ECS* ecs, u32 id, u32 targetID)
{
	ComponentActionSpawn* actionSpawn;
	
	actionSpawn = ecs_component_add(ecs, ECS_COMPONENT_ACTION_SPAWN, id);

	ecs_component_add(ecs, ECS_COMPONENT_ACTION_WAVE, id);

	component_action_spawn_init(actionSpawn, targetID);
}

/* Adds a wave to a spawner entity. */
void
entity_spawner_wave_add(ECS* ecs, u32 id, SpawnWave* spawnWave)
{
	ComponentActionSpawn* actionSpawn;
	
	actionSpawn = ecs_component_get(ecs, ECS_COMPONENT_ACTION_SPAWN, id);

	component_action_spawn_wave_add(actionSpawn, ecs, spawnWave);
}
