Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::ecs::Health Struct Reference

How much damage an entity can still take. More...

#include <aegis2d/ecs/components.hpp>

Public Member Functions

constexpr bool depleted () const noexcept
 Tells whether the entity has no health left.
 

Public Attributes

std::int32_t points = 1
 Remaining health points.
 

Detailed Description

How much damage an entity can still take.

A damage system subtracts from points; the entity is destroyed when it reaches zero or less.

Member Function Documentation

◆ depleted()

constexpr bool aegis2d::ecs::Health::depleted ( ) const
inlineconstexprnoexcept

Tells whether the entity has no health left.

Returns
true when points is zero or negative.

Member Data Documentation

◆ points

std::int32_t aegis2d::ecs::Health::points = 1

Remaining health points.


The documentation for this struct was generated from the following file: