Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/Simulation2.h
Show All 19 Lines | |||||
#include "simulation2/system/CmpPtr.h" | #include "simulation2/system/CmpPtr.h" | ||||
#include "simulation2/system/Components.h" | #include "simulation2/system/Components.h" | ||||
#include "simulation2/helpers/SimulationCommand.h" | #include "simulation2/helpers/SimulationCommand.h" | ||||
#include "scriptinterface/ScriptVal.h" | #include "scriptinterface/ScriptVal.h" | ||||
#include "lib/file/vfs/vfs_path.h" | #include "lib/file/vfs/vfs_path.h" | ||||
#include <boost/unordered_map.hpp> | |||||
#include <map> | #include <map> | ||||
class CSimulation2Impl; | class CSimulation2Impl; | ||||
class CSimContext; | class CSimContext; | ||||
class CUnitManager; | class CUnitManager; | ||||
class CTerrain; | class CTerrain; | ||||
class IComponent; | class IComponent; | ||||
class ScriptInterface; | class ScriptInterface; | ||||
class CMessage; | class CMessage; | ||||
class SceneCollector; | class SceneCollector; | ||||
class CFrustum; | class CFrustum; | ||||
class ScriptRuntime; | class ScriptRuntime; | ||||
template<typename T, typename V, T S> | |||||
class DualFlatMap; | |||||
/** | /** | ||||
* Public API for simulation system. | * Public API for simulation system. | ||||
* Most code should interact with the simulation only through this API. | * Most code should interact with the simulation only through this API. | ||||
*/ | */ | ||||
class CSimulation2 | class CSimulation2 | ||||
{ | { | ||||
NONCOPYABLE(CSimulation2); | NONCOPYABLE(CSimulation2); | ||||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | public: | ||||
*/ | */ | ||||
void FlushDestroyedEntities(); | void FlushDestroyedEntities(); | ||||
IComponent* QueryInterface(entity_id_t ent, int iid) const; | IComponent* QueryInterface(entity_id_t ent, int iid) const; | ||||
void PostMessage(entity_id_t ent, const CMessage& msg) const; | void PostMessage(entity_id_t ent, const CMessage& msg) const; | ||||
void BroadcastMessage(const CMessage& msg) const; | void BroadcastMessage(const CMessage& msg) const; | ||||
typedef std::vector<std::pair<entity_id_t, IComponent*> > InterfaceList; | typedef std::vector<std::pair<entity_id_t, IComponent*> > InterfaceList; | ||||
typedef boost::unordered_map<entity_id_t, IComponent*> InterfaceListUnordered; | typedef DualFlatMap<entity_id_t, IComponent*, FIRST_LOCAL_ENTITY> InterfaceListUnordered; | ||||
/** | /** | ||||
* Returns a list of components implementing the given interface, and their | * Returns a list of components implementing the given interface, and their | ||||
* associated entities, sorted by entity ID. | * associated entities, sorted by entity ID. | ||||
*/ | */ | ||||
InterfaceList GetEntitiesWithInterface(int iid); | InterfaceList GetEntitiesWithInterface(int iid); | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator