Mostly working overlay to show when in combat or not.

This commit is contained in:
Zed A. Shaw 2025-02-20 12:43:52 -05:00
parent 30a7e1b2cc
commit 4a1a8a7d65
4 changed files with 66 additions and 32 deletions

View file

@ -163,6 +163,15 @@ namespace guecs {
return $world.get<Comp>(entity);
}
template <typename Comp>
std::optional<Comp> get_if(DinkyECS::Entity entity) {
if($world.has<Comp>(entity)) {
return std::make_optional<Comp>($world.get<Comp>(entity));
} else {
return std::nullopt;
}
}
template <typename Comp>
void remove(DinkyECS::Entity ent) {
$world.remove<Comp>(ent);