about summary refs log tree commit diff stats
path: root/data/maps/daedalus/rooms/Wonderland.txtpb
blob: 4b69e993beb5578e4aa41f1ed1b7fdfce87aed2d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: "Wonderland"
panel_display_name: "Northwest Area"
# TODO: There's a warp from The Entry into here.
panels {
  name: "APRIL"
  path: "Panels/Wonderland/wonderland_1"
  clue: "april"
  answer: "march"
  symbols: EXAMPLE
}
panels {
  name: "UNDER"
  path: "Panels/Wonderland/wonderland_2"
  clue: "under"
  answer: "wonder"
  symbols: ZERO
}
panels {
  name: "ANGRY"
  path: "Panels/Wonderland/wonderland_3"
  clue: "angry"
  answer: "mad"
  symbols: SUN
}
panels {
  name: "ARTS"
  path: "Panels/Wonderland/wonderland_4"
  clue: "arts"
  answer: "hearts"
  symbols: SPARKLES
}
panels {
  name: "SONG"
  path: "Panels/Wonderland/wonderland_5"
  clue: "song"
  answer: "carol"
  symbols: EXAMPLE
}
ports {
  name: "WONDROUS"
  path: "Components/Warps/Worldports/worldport3"
}
lt'>
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39





                                   

                                                                            




                                                  
 

                                                              
   
                                        
                            
 







                                                    
 

                    
                           

     
 



                                                              
#ifndef ENTITY_MANAGER_CPP_42D78C22
#define ENTITY_MANAGER_CPP_42D78C22

#include "entity_manager.h"

template <>
std::set<EntityManager::id_type> EntityManager::getEntitiesWithComponents<>(
  std::set<std::type_index>& componentTypes)
{
  if (cachedComponents.count(componentTypes) == 1)
  {
    return cachedComponents[componentTypes];
  }

  std::set<id_type>& cache = cachedComponents[componentTypes];
  for (id_type entity = 0; entity < entities.size(); entity++)
  {
    EntityData& data = entities[entity];
    bool cacheEntity = true;

    for (auto& componentType : componentTypes)
    {
      if (data.components.count(componentType) == 0)
      {
        cacheEntity = false;
        break;
      }
    }

    if (cacheEntity)
    {
      cache.insert(entity);
    }
  }

  return cache;
}

#endif /* end of include guard: ENTITY_MANAGER_CPP_42D78C22 */