]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
Update example.
authorAlec Thomas <alec@swapoff.org>
Tue, 23 Jun 2015 15:28:49 +0000 (17:28 +0200)
committerAlec Thomas <alec@swapoff.org>
Tue, 23 Jun 2015 15:28:49 +0000 (17:28 +0200)
examples/example.cc

index d611756da6ed2a197385e31ffb0c60fc4e4b3f3d..7488a748fca3174ddffaa6effb58a0c86e539987 100644 (file)
@@ -33,13 +33,6 @@ using std::endl;
 
 namespace ex = entityx;
 
-namespace std {
-template <>
-struct hash<ex::Entity> {
-  std::size_t operator()(const ex::Entity& k) const { return k.id().id(); }
-};
-}
-
 
 float r(int a, float b = 0) {
   return static_cast<float>(std::rand() % (a * 1000) + b * 1000) / 1000.0;
@@ -94,7 +87,7 @@ public:
   void update(ex::EntityManager &es, ex::EventManager &events, ex::TimeDelta dt) override {
     int c = 0;
     ex::ComponentHandle<Collideable> collideable;
-    for (ex::Entity entity : es.entities_with_components(collideable)) c++;
+    for (ex::Entity entity : es.entities_with_components<Collideable>()) c++;
 
     for (int i = 0; i < count - c; i++) {
       ex::Entity entity = es.create();