A retro style homage to 80s dungeon crawlers hand crafted in C++.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
raycaster/inventory.hpp

23 lines
616 B

#include "dinkyecs.hpp"
#include <unordered_map>
namespace inventory {
using Slot = std::string;
struct Model {
std::unordered_map<Slot, DinkyECS::Entity> by_slot;
std::unordered_map<DinkyECS::Entity, Slot> 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();
};
}