#include "component_health.h"

/* Sets health component info. */
void
component_health_init(ComponentHealth* self, s32 max)
{
	self->max = max;
	self->value = self->max;
}

/* Ticks health component. If health is depleted, marked dead. */
void
component_health_tick(ComponentHealth* self, ECS* ecs)
{
	if (self->value <= 0)
	{
		self->value = 0;
		self->isDead = true;
	}
}
