3 #include <boost/range/adaptor/map.hpp>
5 #include "engine/component.h"
6 #include "engine/system.h"
7 #include "engine/touchable.h"
8 #include "scripting/luabind.h"
9 #include "engine/typedefs.h"
11 #include <luabind/object.hpp>
13 #include <OgreCommon.h>
15 #include <OgreVector3.h>
16 #include <unordered_set>
20 using BoostCompoundMapIterator = boost::range_detail::select_second_mutable_range<std::unordered_map<std::string, CompoundId>>;
21 using BoostAbsorbedMapIterator = boost::range_detail::select_first_range<std::unordered_map<CompoundId, float>>;
57 const std::string& filename
65 luabind::object configTable
91 const std::string& internalName,
92 const std::string& displayName,
93 const std::string& meshName,
125 const std::string& internalName,
126 const std::string& displayName,
127 const std::string& meshName,
130 std::function<
bool(EntityId,
double)>* effect
160 const std::string& internalName,
161 const std::string& displayName,
162 const std::string& meshName,
165 const luabind::object& effect
221 const std::string& internalName
230 static const BoostCompoundMapIterator
246 CompoundId compoundId
261 CompoundId compoundId
272 static std::function<bool(EntityId, double)>*
static CompoundId registerAgentType(const std::string &internalName, const std::string &displayName, const std::string &meshName, double meshScale, int unitVolume, std::function< bool(EntityId, double)> *effect)
Registers a new agent type.
Definition: compound_registry.cpp:256
static int getCompoundUnitVolume(CompoundId id)
Obtains the size of a compound.
Definition: compound_registry.cpp:303
static void loadFromXML(const std::string &filename)
Loads compounds from an XML document.
Definition: compound_registry.cpp:101
static void loadFromLua(luabind::object configTable)
loads compounds from a lua config table
Definition: compound_registry.cpp:80
static std::string getCompoundDisplayName(CompoundId id)
Obtains the display name of an compound.
Definition: compound_registry.cpp:285
static std::string getCompoundMeshName(CompoundId compoundId)
Obtains the name of the corresponding mesh.
Definition: compound_registry.cpp:328
static const BoostCompoundMapIterator getCompoundList()
Obtains the IDs of all currently registered compounds.
Definition: compound_registry.cpp:347
static std::function< bool(EntityId, double)> * getAgentEffect(CompoundId id)
Obtains the effect of the corresponding agent.
Definition: compound_registry.cpp:353
static luabind::scope luaBindings()
Lua bindings.
Definition: compound_registry.cpp:25
Definition: bullet_ogre_conversion.h:6
static CompoundId registerCompoundType(const std::string &internalName, const std::string &displayName, const std::string &meshName, double meshScale, int unitVolume)
Registers a new compound type.
Definition: compound_registry.cpp:213
Static class keeping track of compounds, their Id's, internal and displayed names.
Definition: compound_registry.h:26
static std::string getCompoundInternalName(CompoundId id)
Obtains the internal name of an compound.
Definition: compound_registry.cpp:294
static double getCompoundMeshScale(CompoundId compoundId)
Obtains the scale of the corresponding mesh.
Definition: compound_registry.cpp:337
static CompoundId getCompoundId(const std::string &internalName)
Obtains the Id of an internal name corresponding to a registered compound.
Definition: compound_registry.cpp:312
static bool isAgentType(CompoundId id)
Obtains the scale of the corresponding mesh.
Definition: compound_registry.cpp:363