#include "dinkyecs.hpp" #include // BUG: this should have a bool for "permanent" or "constant" so that // everything working with it knows to do the make_constant/not_constant // dance when using it. Idea is the System:: ops for this would get it // and then look at the bool and add the constant ops as needed. namespace inventory { using Slot = std::string; struct Model { std::unordered_map by_slot; std::unordered_map by_entity; bool add(const Slot &in_slot, DinkyECS::Entity ent); Slot& get(DinkyECS::Entity ent); DinkyECS::Entity get(const Slot& slot); bool has(DinkyECS::Entity ent); bool has(const Slot& slot); void remove(const Slot& slot, DinkyECS::Entity ent); void remove(DinkyECS::Entity ent); void remove(const Slot& slot); void invariant(); void dump(); }; }