Implement a simple combat system and killing off enemies. See status for next steps.
This commit is contained in:
parent
62562faad3
commit
4162287841
4 changed files with 30 additions and 15 deletions
12
dinkyecs.hpp
12
dinkyecs.hpp
|
@ -26,6 +26,12 @@ namespace DinkyECS {
|
|||
return $components[std::type_index(typeid(Comp))];
|
||||
}
|
||||
|
||||
template <typename Comp>
|
||||
void remove(Entity ent) {
|
||||
EntityMap &map = entity_map_for<Comp>();
|
||||
map.erase(ent);
|
||||
}
|
||||
|
||||
template <typename Comp>
|
||||
void set(Comp val) {
|
||||
$facts[std::type_index(typeid(Comp))] = val;
|
||||
|
@ -61,12 +67,6 @@ namespace DinkyECS {
|
|||
}
|
||||
}
|
||||
|
||||
template<typename Comp>
|
||||
void remove(Entity ent) {
|
||||
EntityMap &map = entity_map_for<Comp>();
|
||||
map.erase(ent);
|
||||
}
|
||||
|
||||
template<typename CompA, typename CompB>
|
||||
void system(std::function<void(const Entity&, CompA&, CompB&)> cb) {
|
||||
EntityMap &map_a = entity_map_for<CompA>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue