#pragma once

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

#include "../../input/input.h"
#include "component_sprite.h"
#include "component_physics.h"

typedef struct ComponentGameObject
{
	ECSComponent component;
} ComponentGameObject;

void
component_game_object_init
(
	ComponentGameObject* self,
	ECS* ecs,
	Texture texture,
	vec2 size,
	vec2 physicsSize,
	vec3 position,
	vec3 offset,
	vec4 color,
	f32 friction,
	f32 velocityMax
);

void
component_game_object_atlas_init
(
	ComponentGameObject* self,
	ECS* ecs,
	Texture texture,
	ivec2 frameSize,
	ivec2 atlasSize,
	vec2 size,
	vec2 physicsSize,
	vec3 position,
	vec3 offset,
	vec4 color,
	f32 friction,
	f32 velocityMax
);

void component_game_object_add(ComponentGameObject* self, ECS* ecs);
void component_game_object_delete(ComponentGameObject* self, ECS* ecs);
void component_game_object_tick(ComponentGameObject* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_GAME_OBJECT_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			(ECSFunction)component_game_object_add,
			(ECSFunction)component_game_object_delete,
			(ECSFunction)component_game_object_tick, 
			NULL
		}
	},
	.type = ECS_COMPONENT_GAME_OBJECT,
	.size = sizeof(ComponentGameObject)
};


