aboutsummaryrefslogtreecommitdiffstats
path: root/yage/entity/entitymanager.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-05-20 21:28:00 +0100
committerYann Herklotz <ymherklotz@gmail.com>2018-05-20 21:28:00 +0100
commitd849aae7a61c4c945230c6af051e8c9d5a071380 (patch)
treeaad0b48821f11dd49fe6a2be67d016f9e5f5443c /yage/entity/entitymanager.cpp
parent97448eb557d23138e6a460f496d981ced56b59c9 (diff)
downloadYAGE-d849aae7a61c4c945230c6af051e8c9d5a071380.tar.gz
YAGE-d849aae7a61c4c945230c6af051e8c9d5a071380.zip
Component pool now in entities
Diffstat (limited to 'yage/entity/entitymanager.cpp')
-rw-r--r--yage/entity/entitymanager.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/yage/entity/entitymanager.cpp b/yage/entity/entitymanager.cpp
deleted file mode 100644
index c37bc620..00000000
--- a/yage/entity/entitymanager.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/** ---------------------------------------------------------------------------
- * @file: entitymanager.cpp
- *
- * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
- * MIT License, see LICENSE file for more details.
- * ----------------------------------------------------------------------------
- */
-
-#include "entitymanager.h"
-
-#include <algorithm>
-
-namespace yage
-{
-
-EntityManager::EntityManager(Space *space) : space_(space) {}
-
-EntityManager::EntityManager(Space *space, std::size_t n) : space_(space)
-{
- entities_.reserve(n);
-}
-
-Entity EntityManager::createEntity()
-{
- Entity entity = next_entity_++;
- entities_.push_back(entity);
- return entity;
-}
-
-void EntityManager::deleteEntity(Entity entity)
-{
- auto index = std::find_if(entities_.begin(), entities_.end(),
- [&](Entity &value) { return value == entity; });
- if (index != entities_.end()) {
- entities_.erase(index);
- }
-}
-
-} // namespace yage