#pragma once #include "modeling/Rack.h" #include "modeling/TypeIndex.h" #include namespace Modeling { /* The Room class models the rooms that can be created in the simulation. It contains a list of all entities in the room. */ template class Room { //static_assert(std::is_base_of..., "Each type must be derived from Entity!"); public: /* Initializes the room with the given name. */ explicit Room(int id) : id(id) {} /* Adds the entity to the list of entities in this room. */ template void addEntity(EntityType& e) { std::get::value>(entities).push_back(e); } /* Returns all entities of the given type. */ template std::vector& getEntitiesOfType() { return std::get::value>(entities); } // The id of this room corresponding to its id in the database. const int id; private: // A vector for each type of entity std::tuple...> entities; }; using ServerRoom = Room; using Hallway = Room<>; using PowerRoom = Room<>; }