diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2017-07-09 23:48:06 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2017-07-09 23:48:06 +0200 |
| commit | c94d0c347fdbd8acc774df4ac17617a3f63e4507 (patch) | |
| tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /Simulator/include/modeling/Room.h | |
| parent | bc4c41e21a64b444bdbab3b6d1d407fd5d919419 (diff) | |
Delete old codebase
This change removes version 1 of the OpenDC simulator codebase as it
will be replaced by a complete rewrite in the Kotlin language.
Diffstat (limited to 'Simulator/include/modeling/Room.h')
| -rw-r--r-- | Simulator/include/modeling/Room.h | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/Simulator/include/modeling/Room.h b/Simulator/include/modeling/Room.h deleted file mode 100644 index a57b045e..00000000 --- a/Simulator/include/modeling/Room.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once -#include "modeling/Rack.h" -#include "modeling/TypeIndex.h" - -#include <vector> - -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<typename ...EntityTypes> - class Room - { - //static_assert(std::is_base_of<Entity, EntityTypes>..., "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<typename EntityType> - void addEntity(EntityType& e) - { - std::get<indexOfType<EntityType, EntityTypes...>::value>(entities).push_back(e); - } - - /* - Returns all entities of the given type. - */ - template<typename EntityType> - std::vector<EntityType>& getEntitiesOfType() - { - return std::get<indexOfType<EntityType, EntityTypes...>::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<std::vector<EntityTypes>...> entities; - }; - - using ServerRoom = Room<Modeling::Rack>; - using Hallway = Room<>; - using PowerRoom = Room<>; - -} |
