#pragma once

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

typedef struct ComponentLifetime
{
	ECSComponent component;
	u32 lifetimeMax;
	u32 lifetime;
} ComponentLifetime;

void component_lifetime_init(ComponentLifetime* self, u32 lifetime);
void component_lifetime_tick(ComponentLifetime* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_LIFETIME_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			NULL,
			NULL, 
			(ECSFunction)component_lifetime_tick,
			NULL
		}
	},
	.type = ECS_COMPONENT_LIFETIME,
	.size = sizeof(ComponentLifetime)
};
