Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/system/ComponentManager.h
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | public: | ||||
/** | /** | ||||
* Send a message, targeted at a particular entity. The message will be received by any | * Send a message, targeted at a particular entity. The message will be received by any | ||||
* components of that entity which subscribed to the message type, and by any other components | * components of that entity which subscribed to the message type, and by any other components | ||||
* that subscribed globally to the message type. | * that subscribed globally to the message type. | ||||
*/ | */ | ||||
void PostMessage(entity_id_t ent, const CMessage& msg); | void PostMessage(entity_id_t ent, const CMessage& msg); | ||||
/** | /** | ||||
* Send a message, targeted at the particular entities. The message will be received by any | |||||
* components of those entities which subscribed to the message type, and by any other components | |||||
* that subscribed globally to the message type. | |||||
*/ | |||||
void DistributeMessage(const std::vector<entity_id_t>& entities, const CMessage& msg); | |||||
/** | |||||
* Send a message, not targeted at any particular entity. The message will be received by any | * Send a message, not targeted at any particular entity. The message will be received by any | ||||
* components that subscribed (either globally or not) to the message type. | * components that subscribed (either globally or not) to the message type. | ||||
*/ | */ | ||||
void BroadcastMessage(const CMessage& msg); | void BroadcastMessage(const CMessage& msg); | ||||
/** | /** | ||||
* Resets the dynamic simulation state (deletes all entities, resets entity ID counters; | * Resets the dynamic simulation state (deletes all entities, resets entity ID counters; | ||||
* doesn't unload/reload component scripts). | * doesn't unload/reload component scripts). | ||||
Show All 25 Lines | private: | ||||
static void Script_ReRegisterComponentType(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor); | static void Script_ReRegisterComponentType(ScriptInterface::CxPrivate* pCxPrivate, int iid, const std::string& cname, JS::HandleValue ctor); | ||||
static void Script_RegisterInterface(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name); | static void Script_RegisterInterface(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name); | ||||
static void Script_RegisterMessageType(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name); | static void Script_RegisterMessageType(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name); | ||||
static void Script_RegisterGlobal(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name, JS::HandleValue value); | static void Script_RegisterGlobal(ScriptInterface::CxPrivate* pCxPrivate, const std::string& name, JS::HandleValue value); | ||||
static IComponent* Script_QueryInterface(ScriptInterface::CxPrivate* pCxPrivate, int ent, int iid); | static IComponent* Script_QueryInterface(ScriptInterface::CxPrivate* pCxPrivate, int ent, int iid); | ||||
static std::vector<int> Script_GetEntitiesWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid); | static std::vector<int> Script_GetEntitiesWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid); | ||||
static std::vector<IComponent*> Script_GetComponentsWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid); | static std::vector<IComponent*> Script_GetComponentsWithInterface(ScriptInterface::CxPrivate* pCxPrivate, int iid); | ||||
static void Script_PostMessage(ScriptInterface::CxPrivate* pCxPrivate, int ent, int mtid, JS::HandleValue data); | static void Script_PostMessage(ScriptInterface::CxPrivate* pCxPrivate, int ent, int mtid, JS::HandleValue data); | ||||
static void Script_DistributeMessage(ScriptInterface::CxPrivate* pCxPrivate, const std::vector<entity_id_t>& entities, int mtid, JS::HandleValue data); | |||||
Freagarach: `entities` | |||||
static void Script_BroadcastMessage(ScriptInterface::CxPrivate* pCxPrivate, int mtid, JS::HandleValue data); | static void Script_BroadcastMessage(ScriptInterface::CxPrivate* pCxPrivate, int mtid, JS::HandleValue data); | ||||
static int Script_AddEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | static int Script_AddEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | ||||
static int Script_AddLocalEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | static int Script_AddLocalEntity(ScriptInterface::CxPrivate* pCxPrivate, const std::string& templateName); | ||||
static void Script_DestroyEntity(ScriptInterface::CxPrivate* pCxPrivate, int ent); | static void Script_DestroyEntity(ScriptInterface::CxPrivate* pCxPrivate, int ent); | ||||
static void Script_FlushDestroyedEntities(ScriptInterface::CxPrivate* pCxPrivate); | static void Script_FlushDestroyedEntities(ScriptInterface::CxPrivate* pCxPrivate); | ||||
CMessage* ConstructMessage(int mtid, JS::HandleValue data); | CMessage* ConstructMessage(int mtid, JS::HandleValue data); | ||||
void SendMessageTo(entity_id_t ent, const CMessage& msg); | |||||
void SendGlobalMessage(entity_id_t ent, const CMessage& msg); | void SendGlobalMessage(entity_id_t ent, const CMessage& msg); | ||||
void FlattenDynamicSubscriptions(); | void FlattenDynamicSubscriptions(); | ||||
void RemoveComponentDynamicSubscriptions(IComponent* component); | void RemoveComponentDynamicSubscriptions(IComponent* component); | ||||
ComponentTypeId GetScriptWrapper(InterfaceId iid); | ComponentTypeId GetScriptWrapper(InterfaceId iid); | ||||
CEntityHandle AllocateEntityHandle(entity_id_t ent); | CEntityHandle AllocateEntityHandle(entity_id_t ent); | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
entities