aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-02-12 17:07:55 -0500
committerClyne Sullivan <tullivan99@gmail.com>2017-02-12 17:07:55 -0500
commit3eccd38e989012ff35ee5376670aabc338c52008 (patch)
treee245a1db2f737feb0546c8d83e0673ca210b28df /include
parent7189e7d0d5130b7bb37c4d65e595b1608b3c39c8 (diff)
locked EM.each, arenas
Diffstat (limited to 'include')
-rw-r--r--include/engine.hpp32
1 files changed, 1 insertions, 31 deletions
diff --git a/include/engine.hpp b/include/engine.hpp
index 112fd3c..5824950 100644
--- a/include/engine.hpp
+++ b/include/engine.hpp
@@ -65,36 +65,6 @@ public:
}
};
-class LockableEntityManager : public entityx::EntityManager {
-private:
- std::atomic_bool locked;
-
-public:
- LockableEntityManager(entityx::EventManager& ev)
- : EntityManager(ev) {
- locked.store(false);
- }
-
- void lock(void) {
- while (locked.load())
- std::this_thread::sleep_for(std::chrono::milliseconds(10));
-
- locked.store(true);
- }
-
- void unlock(void) {
- locked.store(false);
- }
-
- bool try_lock(void) {
- if (locked.load())
- return false;
-
- locked.store(true);
- return true;
- }
-};
-
namespace game {
/**
* Handles all game events.
@@ -104,7 +74,7 @@ namespace game {
/**
* Handles entity data.
*/
- extern LockableEntityManager entities;
+ extern entityx::EntityManager entities;
/**
* An instance of the main game engine.