Started working on the loot system which will eventually become the inventory/improved collision system.
This commit is contained in:
parent
c1d43694b0
commit
0a268591c2
5 changed files with 55 additions and 29 deletions
|
@ -74,6 +74,13 @@ namespace DinkyECS {
|
|||
return std::any_cast<Comp&>(res);
|
||||
}
|
||||
|
||||
template <typename Comp>
|
||||
bool has(Entity ent) {
|
||||
EntityMap &map = entity_map_for<Comp>();
|
||||
// use .at for bounds checking
|
||||
return map.contains(ent);
|
||||
}
|
||||
|
||||
template<typename Comp>
|
||||
void query(std::function<void(const Entity&, Comp&)> cb) {
|
||||
EntityMap &map = entity_map_for<Comp>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue