calamity-cobra-2/src/game/ecs/component/component_lifetime.h
2023-08-15 18:04:43 -04:00

31 lines
549 B
C

#pragma once
#include "../../GAME_COMMON.h"
#include "../ecs_entity.h"
typedef struct ComponentLifetime
{
u32 id;
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)
};