Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpTest.cpp
Show All 22 Lines | |||||
#include "simulation2/scripting/ScriptComponent.h" | #include "simulation2/scripting/ScriptComponent.h" | ||||
#include "simulation2/MessageTypes.h" | #include "simulation2/MessageTypes.h" | ||||
class CCmpTest1A : public ICmpTest1 | class CCmpTest1A : public ICmpTest1 | ||||
{ | { | ||||
public: | public: | ||||
static void ClassInit(CComponentManager& componentManager) | static void ClassInit(CComponentManager& componentManager) | ||||
{ | { | ||||
componentManager.SubscribeToMessageType(MT_TurnStart); | componentManager.SubscribeToMessageType(CID_Test1A, MT_TurnStart); | ||||
componentManager.SubscribeToMessageType(MT_Interpolate); | componentManager.SubscribeToMessageType(CID_Test1A, MT_Interpolate); | ||||
componentManager.SubscribeToMessageType(MT_Destroy); | componentManager.SubscribeToMessageType(CID_Test1A, MT_Destroy); | ||||
} | } | ||||
DEFAULT_COMPONENT_ALLOCATOR(Test1A) | DEFAULT_COMPONENT_ALLOCATOR(Test1A) | ||||
int32_t m_x; | int32_t m_x; | ||||
static std::string GetSchema() | static std::string GetSchema() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
REGISTER_COMPONENT_TYPE(Test1A) | REGISTER_COMPONENT_TYPE(Test1A) | ||||
class CCmpTest1B : public ICmpTest1 | class CCmpTest1B : public ICmpTest1 | ||||
{ | { | ||||
public: | public: | ||||
static void ClassInit(CComponentManager& componentManager) | static void ClassInit(CComponentManager& componentManager) | ||||
{ | { | ||||
componentManager.SubscribeToMessageType(MT_Update); | componentManager.SubscribeToMessageType(CID_Test1B, MT_Update); | ||||
componentManager.SubscribeGloballyToMessageType(MT_Interpolate); | componentManager.SubscribeGloballyToMessageType(CID_Test1B, MT_Interpolate); | ||||
} | } | ||||
DEFAULT_COMPONENT_ALLOCATOR(Test1B) | DEFAULT_COMPONENT_ALLOCATOR(Test1B) | ||||
int32_t m_x; | int32_t m_x; | ||||
static std::string GetSchema() | static std::string GetSchema() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
REGISTER_COMPONENT_TYPE(Test1B) | REGISTER_COMPONENT_TYPE(Test1B) | ||||
class CCmpTest2A : public ICmpTest2 | class CCmpTest2A : public ICmpTest2 | ||||
{ | { | ||||
public: | public: | ||||
static void ClassInit(CComponentManager& componentManager) | static void ClassInit(CComponentManager& componentManager) | ||||
{ | { | ||||
componentManager.SubscribeToMessageType(MT_TurnStart); | componentManager.SubscribeToMessageType(CID_Test2A, MT_TurnStart); | ||||
componentManager.SubscribeToMessageType(MT_Update); | componentManager.SubscribeToMessageType(CID_Test2A, MT_Update); | ||||
} | } | ||||
DEFAULT_COMPONENT_ALLOCATOR(Test2A) | DEFAULT_COMPONENT_ALLOCATOR(Test2A) | ||||
int32_t m_x; | int32_t m_x; | ||||
static std::string GetSchema() | static std::string GetSchema() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator