#pragma once

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

#include "../../entity/play/entity_goodie.h"
#include "../stat/component_game_entity_type.h"

#define COMPONENT_ACTION_ON_DELETE_DROP_GOODIES_VELOCITY_MIN -10.0f
#define COMPONENT_ACTION_ON_DELETE_DROP_GOODIES_VELOCITY_MAX 10.0f
#define COMPONENT_ACTION_ON_DELETE_DROP_GOODIES_HEIGHT_MIN 0.0f
#define COMPONENT_ACTION_ON_DELETE_DROP_GOODIES_HEIGHT_SPECIAL 500.0f
#define COMPONENT_ACTION_ON_DELETE_DROP_GOODIES_HEIGHT_SPECIAL_CHANCE 0.01
#define COMPONENT_ACTION_ON_DELETE_DROP_GOODIES_HEIGHT_MAX 30.0f

static const s32 GAME_ENTITY_GOODIE_INDEX[GAME_ENTITY_TYPE_COUNT] = 
{
	-1,
	-1,
	0,
	1,
	-1,
	2,
	3,
	4,
	5,
	6,
	7,
	8,
	9,
	-1,
	-1,
	-1
};

typedef struct ComponentActionOnDeleteDropGoodies
{
	ECSComponent component;
	u32 count;
} ComponentActionOnDeleteDropGoodies;

void component_action_on_delete_drop_goodies_init(ComponentActionOnDeleteDropGoodies* self, u32 count);
void component_action_on_delete_drop_goodies_delete(ComponentActionOnDeleteDropGoodies* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_ACTION_ON_DELETE_DROP_GOODIES_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			NULL,
			(ECSFunction)component_action_on_delete_drop_goodies_delete,
			NULL,
			NULL
		}
	},
	.type = ECS_COMPONENT_ACTION_ON_DELETE_DROP_GOODIES,
	.size = sizeof(ComponentActionOnDeleteDropGoodies)
};


