#include "entity_cupper.h"

/* Initializes a Cupper entity. */
void
entity_cupper_init(ECS* ecs, u32 id, vec3 position, u32 targetID, u32 level, Vector* entityList)
{
	ComponentEnemy* enemy;
	ComponentBehaviorHop* behaviorHop;

	behaviorHop = ecs_component_add(ecs, ECS_COMPONENT_BEHAVIOR_HOP, id);
	enemy = ecs_component_add(ecs, ECS_COMPONENT_ENEMY, id);

	component_enemy_init
	(
		enemy,
		ecs,
		ecs->game->resources.textures[TEXTURE_CUPPER],
		(s32*)CUPPER_FRAME_SIZE,
		(s32*)CUPPER_ATLAS_SIZE,
		(f32*)CUPPER_SIZE,
		(f32*)CUPPER_PHYSICS_SIZE,
		position,
		CUPPER_FRICTION,
		CUPPER_VELOCITY_MAX,
		CUPPER_HEALTH_MAX,
		CUPPER_IS_BOUNCE,
		CUPPER_IS_AFFECTED_BY_GRAVITY,
		CUPPER_IS_SOLID,
		CUPPER_GOODIE_COUNT,
		level,
		entityList
	);

	component_behavior_hop_init
	(
		behaviorHop,
		CUPPER_BEHAVIOR_HOP_HEIGHT_VELOCITY,
		CUPPER_BEHAVIOR_HOP_SPEED,
		CUPPER_BEHAVIOR_HOP_TIMER,
		targetID
	);

	ComponentGameEntityType* gameEntityType; 

	gameEntityType = ecs_component_add(ecs, ECS_COMPONENT_GAME_ENTITY_TYPE, id); 

	component_game_entity_type_init
	(
		gameEntityType, 
		GAME_ENTITY_CUPPER 
	);
}
