Thrive
script_entity_filter.h
1 #pragma once
2 
3 #include "engine/typedefs.h"
4 #include "scripting/luabind.h"
5 
6 #include <luabind/object.hpp>
7 #include <memory>
8 #include <unordered_set>
9 
10 namespace thrive {
11 
12 class GameState;
13 
18 
19 public:
20 
33  static luabind::scope
34  luaBindings();
35 
47  luabind::object componentTypes,
48  bool recordChanges
49  );
50 
62  luabind::object componentTypes
63  );
64 
69 
77  const std::unordered_set<EntityId>&
78  addedEntities();
79 
83  void
84  clearChanges();
85 
95  bool
97  EntityId id
98  ) const;
99 
104  const std::unordered_set<EntityId>&
105  entities();
106 
110  void
111  init(
112  GameState* gameState
113  );
114 
121  const std::unordered_set<EntityId>&
122  removedEntities();
123 
127  void
128  shutdown();
129 
130 private:
131 
132  struct Implementation;
133  std::unique_ptr<Implementation> m_impl;
134 
135 
136 };
137 
138 }
ScriptEntityFilter(luabind::object componentTypes, bool recordChanges)
Constructor.
Definition: script_entity_filter.cpp:158
~ScriptEntityFilter()
Destructor.
Definition: script_entity_filter.cpp:173
static luabind::scope luaBindings()
Lua bindings.
Definition: script_entity_filter.cpp:142
const std::unordered_set< EntityId > & removedEntities()
The set of removed entities.
Definition: script_entity_filter.cpp:222
void shutdown()
Shuts this filter down.
Definition: script_entity_filter.cpp:228
Script version of the EntityFilter.
Definition: script_entity_filter.h:17
const std::unordered_set< EntityId > & entities()
The set of entities that are contained in this filter.
Definition: script_entity_filter.cpp:203
const std::unordered_set< EntityId > & addedEntities()
Returns the set of added entities.
Definition: script_entity_filter.cpp:182
Definition: bullet_ogre_conversion.h:6
bool containsEntity(EntityId id) const
Checks for an entity id.
Definition: script_entity_filter.cpp:195
Represents a distinct set of active systems and entities.
Definition: game_state.h:41
void clearChanges()
Clears added and removed entities from this filter.
Definition: script_entity_filter.cpp:188
void init(GameState *gameState)
Initializes this filter.
Definition: script_entity_filter.cpp:212