#pragma once

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

#include "../component_game_object.h"

#include "../stat/component_level.h"

#define COMPONENT_BEHAVIOR_HOP_LEVEL_TIMER_MULTIPLIER 2
#define COMPONENT_BEHAVIOR_HOP_TIMER_MINIMUM 3
#define COMPONENT_BEHAVIOR_HOP_LEVEL_SPEED_MULTIPLIER 1.15
#define COMPONENT_BEHAVIOR_HOP_SPEED_MAX 20.0

typedef struct ComponentBehaviorHop
{
	ECSComponent component;
	f32 speed;
	f32 heightVelocity;
	u32 timer;
	u32 timerMax;
	u32 targetID;
	bool isHop;
	bool isHopping;
} ComponentBehaviorHop;

void component_behavior_hop_init
(
	ComponentBehaviorHop* self, 
	f32 heightVelocity, 
	f32 speed,
	u32 timer, 
	u32 targetID
);

void component_behavior_hop_tick(ComponentBehaviorHop* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_BEHAVIOR_HOP_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			NULL,
			NULL, 
			(ECSFunction)component_behavior_hop_tick,
			NULL
		}
	},
	.type = ECS_COMPONENT_BEHAVIOR_HOP,
	.size = sizeof(ComponentBehaviorHop)
};


