Mostly working overlay to show when in combat or not.
This commit is contained in:
parent
30a7e1b2cc
commit
4a1a8a7d65
4 changed files with 66 additions and 32 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue