aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/entities
diff options
context:
space:
mode:
authorJulien2012-07-26 16:26:35 -0400
committerJulien2012-07-27 00:15:05 -0400
commitb4b4a7d127194cf29fdfcf5ee7b41b875d26b37e (patch)
tree5082d4dd985a11ce366a75c283f2b0a238aa5727 /engines/lastexpress/entities
parent2d6f7992351c9737f71964ad64c307fa6d1543cf (diff)
downloadscummvm-rg350-b4b4a7d127194cf29fdfcf5ee7b41b875d26b37e.tar.gz
scummvm-rg350-b4b4a7d127194cf29fdfcf5ee7b41b875d26b37e.tar.bz2
scummvm-rg350-b4b4a7d127194cf29fdfcf5ee7b41b875d26b37e.zip
LASTEXPRESS: Replace setup macros by functions
Diffstat (limited to 'engines/lastexpress/entities')
-rw-r--r--engines/lastexpress/entities/entity.cpp40
-rw-r--r--engines/lastexpress/entities/entity.h375
2 files changed, 285 insertions, 130 deletions
diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp
index a9ceaa16a9..8595978390 100644
--- a/engines/lastexpress/entities/entity.cpp
+++ b/engines/lastexpress/entities/entity.cpp
@@ -596,6 +596,46 @@ void Entity::callbackAction() {
}
//////////////////////////////////////////////////////////////////////////
+// Setup functions
+//////////////////////////////////////////////////////////////////////////
+void Entity::setup(const char *name, uint index) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s()", name);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersIIII>();
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+}
+
+void Entity::setupS(const char *name, uint index, const char *seq1) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%s)", name, seq1);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersSIIS>();
+
+ EntityData::EntityParametersSIIS *params = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters();
+ strncpy((char *)&params->seq1, seq1, 12);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+}
+
+void Entity::setupSS(const char *name, uint index, const char *seq1, const char *seq2) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%s, %s)", name, seq1, seq2);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersSSII>();
+
+ EntityData::EntityParametersSSII *params = (EntityData::EntityParametersSSII*)_data->getCurrentParameters();
+ strncpy((char *)&params->seq1, seq1, 12);
+ strncpy((char *)&params->seq2, seq2, 12);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+}
+
+//////////////////////////////////////////////////////////////////////////
// Helper functions
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h
index 6a32fb6de0..18039e9432 100644
--- a/engines/lastexpress/entities/entity.h
+++ b/engines/lastexpress/entities/entity.h
@@ -108,26 +108,6 @@ struct SavePoint;
((class *)getEntities()->get(entity))->function();
//////////////////////////////////////////////////////////////////////////
-// Setup
-//////////////////////////////////////////////////////////////////////////
-
-#define IMPLEMENT_SETUP(class, name, index) \
-void class::setup_##name() { \
- BEGIN_SETUP(index, EntityData::EntityParametersIIII) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::setup_" #name "()"); \
- END_SETUP() \
-}
-
-#define BEGIN_SETUP(index, type) \
- _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]); \
- _data->setCurrentCallback(index); \
- _data->resetCurrentParameters<type>();
-
-#define END_SETUP() \
- _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
-
-
-//////////////////////////////////////////////////////////////////////////
// Implementation
//////////////////////////////////////////////////////////////////////////
@@ -137,7 +117,6 @@ void class::setup_##name() { \
if (!params) \
error("[EXPOSE_PARAMS] Trying to call an entity function with invalid parameters"); \
-
// function signature without setup (we keep the index for consistency but never use it)
#define IMPLEMENT_FUNCTION_NOSETUP(index, class, name) \
void class::name(const SavePoint &savepoint) { \
@@ -145,7 +124,9 @@ void class::setup_##name() { \
// simple setup with no parameters
#define IMPLEMENT_FUNCTION(index, class, name) \
- IMPLEMENT_SETUP(class, name, index) \
+ void class::setup_##name() { \
+ Entity::setup(#class "::setup_" #name, index); \
+ } \
void class::name(const SavePoint &savepoint) { \
EXPOSE_PARAMS(EntityData::EntityParametersIIII) \
debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "() - action: %s", ACTION_NAME(savepoint.action));
@@ -154,191 +135,128 @@ void class::setup_##name() { \
// nullfunction call
#define IMPLEMENT_NULL_FUNCTION(index, class) \
- IMPLEMENT_SETUP(class, nullfunction, index)
+ void class::setup_nullfunction() { \
+ Entity::setup(#class "::setup_nullfunction", index); \
+ }
// setup with one uint parameter
#define IMPLEMENT_FUNCTION_I(index, class, name, paramType) \
void class::setup_##name(paramType param1) { \
- BEGIN_SETUP(index, EntityData::EntityParametersIIII) \
- EntityData::EntityParametersIIII *params = (EntityData::EntityParametersIIII*)_data->getCurrentParameters(); \
- params->param1 = (unsigned int)param1; \
- END_SETUP() \
+ Entity::setupI<paramType>(#class "::setup_" #name, index, param1); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersIIII) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d) - action: %s", params->param1, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersIIII) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d) - action: %s", params->param1, ACTION_NAME(savepoint.action));
// setup with two uint parameters
#define IMPLEMENT_FUNCTION_II(index, class, name, paramType1, paramType2) \
void class::setup_##name(paramType1 param1, paramType2 param2) { \
- BEGIN_SETUP(index, EntityData::EntityParametersIIII) \
- EntityData::EntityParametersIIII *params = (EntityData::EntityParametersIIII*)_data->getCurrentParameters(); \
- params->param1 = param1; \
- params->param2 = param2; \
- END_SETUP() \
+ Entity::setupII<paramType1, paramType2>(#class "::setup_" #name, index, param1, param2); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersIIII) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %d) - action: %s", params->param1, params->param2, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersIIII) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %d) - action: %s", params->param1, params->param2, ACTION_NAME(savepoint.action));
// setup with three uint parameters
#define IMPLEMENT_FUNCTION_III(index, class, name, paramType1, paramType2, paramType3) \
void class::setup_##name(paramType1 param1, paramType2 param2, paramType3 param3) { \
- BEGIN_SETUP(index, EntityData::EntityParametersIIII) \
- EntityData::EntityParametersIIII *params = (EntityData::EntityParametersIIII*)_data->getCurrentParameters(); \
- params->param1 = param1; \
- params->param2 = param2; \
- params->param3 = param3; \
- END_SETUP() \
+ Entity::setupIII<paramType1, paramType2, paramType3>(#class "::setup_" #name, index, param1, param2, param3); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersIIII) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %d, %d) - action: %s", params->param1, params->param2, params->param3, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersIIII) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %d, %d) - action: %s", params->param1, params->param2, params->param3, ACTION_NAME(savepoint.action));
// setup with one char *parameter
#define IMPLEMENT_FUNCTION_S(index, class, name) \
void class::setup_##name(const char *seq1) { \
- BEGIN_SETUP(index, EntityData::EntityParametersSIIS) \
- EntityData::EntityParametersSIIS *params = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters(); \
- strncpy((char *)&params->seq1, seq1, 12); \
- END_SETUP() \
+ Entity::setupS(#class "::setup_" #name, index, seq1); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersSIIS) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s) - action: %s", (char *)&params->seq1, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersSIIS) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s) - action: %s", (char *)&params->seq1, ACTION_NAME(savepoint.action));
// setup with one char *parameter and one uint
#define IMPLEMENT_FUNCTION_SI(index, class, name, paramType2) \
void class::setup_##name(const char *seq1, paramType2 param4) { \
- BEGIN_SETUP(index, EntityData::EntityParametersSIIS) \
- EntityData::EntityParametersSIIS *params = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters(); \
- strncpy((char *)&params->seq1, seq1, 12); \
- params->param4 = param4; \
- END_SETUP() \
+ Entity::setupSI<paramType2>(#class "::setup_" #name, index, seq1, param4); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersSIIS) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %d) - action: %s", (char *)&params->seq1, params->param4, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersSIIS) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %d) - action: %s", (char *)&params->seq1, params->param4, ACTION_NAME(savepoint.action));
// setup with one char *parameter and two uints
#define IMPLEMENT_FUNCTION_SII(index, class, name, paramType2, paramType3) \
void class::setup_##name(const char *seq1, paramType2 param4, paramType3 param5) { \
- BEGIN_SETUP(index, EntityData::EntityParametersSIIS) \
- EntityData::EntityParametersSIIS *params = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters(); \
- strncpy((char *)&params->seq1, seq1, 12); \
- params->param4 = param4; \
- params->param5 = param5; \
- END_SETUP() \
+ Entity::setupSII<paramType2, paramType3>(#class "::setup_" #name, index, seq1, param4, param5); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersSIIS) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %d, %d) - action: %s", (char *)&params->seq1, params->param4, params->param5, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersSIIS) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %d, %d) - action: %s", (char *)&params->seq1, params->param4, params->param5, ACTION_NAME(savepoint.action));
// setup with one char *parameter and three uints
#define IMPLEMENT_FUNCTION_SIII(index, class, name, paramType2, paramType3, paramType4) \
void class::setup_##name(const char *seq, paramType2 param4, paramType3 param5, paramType4 param6) { \
- BEGIN_SETUP(index, EntityData::EntityParametersSIII) \
- EntityData::EntityParametersSIII *params = (EntityData::EntityParametersSIII*)_data->getCurrentParameters(); \
- strncpy((char *)&params->seq, seq, 12); \
- params->param4 = param4; \
- params->param5 = param5; \
- params->param6 = param6; \
- END_SETUP() \
+ Entity::setupSIII<paramType2, paramType3, paramType4>(#class "::setup_" #name, index, seq, param4, param5, param6); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersSIII) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %d, %d, %d) - action: %s", (char *)&params->seq, params->param4, params->param5, params->param6, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersSIII) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %d, %d, %d) - action: %s", (char *)&params->seq, params->param4, params->param5, params->param6, ACTION_NAME(savepoint.action));
#define IMPLEMENT_FUNCTION_SIIS(index, class, name, paramType2, paramType3) \
void class::setup_##name(const char *seq1, paramType2 param4, paramType3 param5, const char *seq2) { \
- BEGIN_SETUP(index, EntityData::EntityParametersSIIS) \
- EntityData::EntityParametersSIIS *params = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters(); \
- strncpy((char *)&params->seq1, seq1, 12); \
- params->param4 = param4; \
- params->param5 = param5; \
- strncpy((char *)&params->seq2, seq2, 12); \
- END_SETUP() \
+ Entity::setupSIIS<paramType2, paramType3>(#class "::setup_" #name, index, seq1, param4, param5, seq2); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersSIIS) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %d, %d, %s) - action: %s", (char *)&params->seq1, params->param4, params->param5, (char *)&params->seq2, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersSIIS) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %d, %d, %s) - action: %s", (char *)&params->seq1, params->param4, params->param5, (char *)&params->seq2, ACTION_NAME(savepoint.action));
#define IMPLEMENT_FUNCTION_SS(index, class, name) \
void class::setup_##name(const char *seq1, const char *seq2) { \
- BEGIN_SETUP(index, EntityData::EntityParametersSSII) \
- EntityData::EntityParametersSSII *params = (EntityData::EntityParametersSSII*)_data->getCurrentParameters(); \
- strncpy((char *)&params->seq1, seq1, 12); \
- strncpy((char *)&params->seq2, seq2, 12); \
- END_SETUP() \
+ Entity::setupSS(#class "::setup_" #name, index, seq1, seq2); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersSSII) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %s) - action: %s", (char *)&params->seq1, (char *)&params->seq2, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersSSII) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %s) - action: %s", (char *)&params->seq1, (char *)&params->seq2, ACTION_NAME(savepoint.action));
#define IMPLEMENT_FUNCTION_SSI(index, class, name, paramType3) \
void class::setup_##name(const char *seq1, const char *seq2, paramType3 param7) { \
- BEGIN_SETUP(index, EntityData::EntityParametersSSII) \
- EntityData::EntityParametersSSII *params = (EntityData::EntityParametersSSII*)_data->getCurrentParameters(); \
- strncpy((char *)&params->seq1, seq1, 12); \
- strncpy((char *)&params->seq2, seq2, 12); \
- params->param7 = param7; \
- END_SETUP() \
+ Entity::setupSSI<paramType3>(#class "::setup_" #name, index, seq1, seq2, param7); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersSSII) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %s, %d) - action: %s", (char *)&params->seq1, (char *)&params->seq2, params->param7, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersSSII) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%s, %s, %d) - action: %s", (char *)&params->seq1, (char *)&params->seq2, params->param7, ACTION_NAME(savepoint.action));
#define IMPLEMENT_FUNCTION_IS(index, class, name, paramType) \
void class::setup_##name(paramType param1, const char *seq) { \
- BEGIN_SETUP(index, EntityData::EntityParametersISII) \
- EntityData::EntityParametersISII *params = (EntityData::EntityParametersISII*)_data->getCurrentParameters(); \
- params->param1 = (unsigned int)param1; \
- strncpy((char *)&params->seq, seq, 12); \
- END_SETUP() \
+ Entity::setupIS<paramType>(#class "::setup_" #name, index, param1, seq); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersISII) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %s) - action: %s", params->param1, (char *)&params->seq, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersISII) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %s) - action: %s", params->param1, (char *)&params->seq, ACTION_NAME(savepoint.action));
#define IMPLEMENT_FUNCTION_ISS(index, class, name, paramType) \
void class::setup_##name(paramType param1, const char *seq1, const char *seq2) { \
- BEGIN_SETUP(index, EntityData::EntityParametersISSI) \
- EntityData::EntityParametersISSI *params = (EntityData::EntityParametersISSI*)_data->getCurrentParameters(); \
- params->param1 = param1; \
- strncpy((char *)&params->seq1, seq1, 12); \
- strncpy((char *)&params->seq2, seq2, 12); \
- END_SETUP() \
+ Entity::setupISS<paramType>(#class "::setup_" #name, index, param1, seq1, seq2); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersISSI) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %s, %s) - action: %s", params->param1, (char *)&params->seq1, (char *)&params->seq2, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersISSI) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %s, %s) - action: %s", params->param1, (char *)&params->seq1, (char *)&params->seq2, ACTION_NAME(savepoint.action));
#define IMPLEMENT_FUNCTION_IIS(index, class, name, paramType1, paramType2) \
void class::setup_##name(paramType1 param1, paramType2 param2, const char *seq) { \
- BEGIN_SETUP(index, EntityData::EntityParametersIISI) \
- EntityData::EntityParametersIISI *params = (EntityData::EntityParametersIISI*)_data->getCurrentParameters(); \
- params->param1 = param1; \
- params->param2 = param2; \
- strncpy((char *)&params->seq, seq, 12); \
- END_SETUP() \
+ Entity::setupIIS<paramType1, paramType2>(#class "::setup_" #name, index, param1, param2, seq); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersIISI) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %d, %s) - action: %s", params->param1, params->param2, (char *)&params->seq, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersIISI) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %d, %s) - action: %s", params->param1, params->param2, (char *)&params->seq, ACTION_NAME(savepoint.action));
#define IMPLEMENT_FUNCTION_IISS(index, class, name, paramType1, paramType2) \
void class::setup_##name(paramType1 param1, paramType2 param2, const char *seq1, const char *seq2) { \
- BEGIN_SETUP(index, EntityData::EntityParametersIISS) \
- EntityData::EntityParametersIISS *params = (EntityData::EntityParametersIISS*)_data->getCurrentParameters(); \
- params->param1 = param1; \
- params->param2 = param2; \
- strncpy((char *)&params->seq1, seq1, 12); \
- strncpy((char *)&params->seq2, seq2, 12); \
- END_SETUP() \
+ Entity::setupIISS<paramType1, paramType2>(#class "::setup_" #name, index, param1, param2, seq1, seq2); \
} \
void class::name(const SavePoint &savepoint) { \
- EXPOSE_PARAMS(EntityData::EntityParametersIISS) \
- debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %d, %s, %s) - action: %s", params->param1, params->param2, (char *)&params->seq1, (char *)&params->seq2, ACTION_NAME(savepoint.action));
+ EXPOSE_PARAMS(EntityData::EntityParametersIISS) \
+ debugC(6, kLastExpressDebugLogic, "Entity: " #class "::" #name "(%d, %d, %s, %s) - action: %s", params->param1, params->param2, (char *)&params->seq1, (char *)&params->seq2, ACTION_NAME(savepoint.action));
//////////////////////////////////////////////////////////////////////////
@@ -1145,6 +1063,203 @@ protected:
void callbackAction();
//////////////////////////////////////////////////////////////////////////
+ // Setup functions
+ //////////////////////////////////////////////////////////////////////////
+ void setup(const char *name, uint index);
+ void setupS(const char *name, uint index, const char *seq1);
+ void setupSS(const char *name, uint index, const char *seq1, const char *seq2);
+
+ template<typename T>
+ void setupI(const char *name, uint index, T param1) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%d)", name, param1);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersIIII>();
+
+ EntityData::EntityParametersIIII *params = (EntityData::EntityParametersIIII*)_data->getCurrentParameters();
+ params->param1 = (unsigned int)param1;
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T1, typename T2>
+ void setupII(const char *name, uint index, T1 param1, T2 param2) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%d, %d)", name, param1, param2);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersIIII>();
+
+ EntityData::EntityParametersIIII *params = (EntityData::EntityParametersIIII*)_data->getCurrentParameters();
+ params->param1 = param1;
+ params->param2 = param2;
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T1, typename T2, typename T3>
+ void setupIII(const char *name, uint index, T1 param1, T2 param2, T3 param3) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%d, %d, %d)", name, param1, param2, param3);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersIIII>();
+
+ EntityData::EntityParametersIIII *params = (EntityData::EntityParametersIIII*)_data->getCurrentParameters();
+ params->param1 = param1;
+ params->param2 = param2;
+ params->param3 = param3;
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T>
+ void setupSI(const char *name, uint index, const char *seq1, T param4) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%s, %d)", name, seq1, param4);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersSIIS>();
+
+ EntityData::EntityParametersSIIS *params = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters();
+ strncpy((char *)&params->seq1, seq1, 12);
+ params->param4 = param4;
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T1, typename T2>
+ void setupSII(const char *name, uint index, const char *seq1, T1 param4, T2 param5) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%s, %d, %d)", name, seq1, param4, param5);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersSIIS>();
+
+ EntityData::EntityParametersSIIS *params = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters();
+ strncpy((char *)&params->seq1, seq1, 12);
+ params->param4 = param4;
+ params->param5 = param5;
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T1, typename T2, typename T3>
+ void setupSIII(const char *name, uint index, const char *seq, T1 param4, T2 param5, T3 param6) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%s, %d, %d, %d)", name, seq, param4, param5, param6);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersSIII>();
+
+ EntityData::EntityParametersSIII *params = (EntityData::EntityParametersSIII*)_data->getCurrentParameters();
+ strncpy((char *)&params->seq, seq, 12);
+ params->param4 = param4;
+ params->param5 = param5;
+ params->param6 = param6;
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T1, typename T2>
+ void setupSIIS(const char *name, uint index, const char *seq1, T1 param4, T2 param5, const char *seq2) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%s, %d, %d, %s)", name, seq1, param4, param5, seq2);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersSIIS>();
+
+ EntityData::EntityParametersSIIS *params = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters();
+ strncpy((char *)&params->seq1, seq1, 12);
+ params->param4 = param4;
+ params->param5 = param5;
+ strncpy((char *)&params->seq2, seq2, 12);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T>
+ void setupSSI(const char *name, uint index, const char *seq1, const char *seq2, T param7) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%s, %s, %d)", name, seq1, seq2, param7);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersSSII>();
+
+ EntityData::EntityParametersSSII *params = (EntityData::EntityParametersSSII*)_data->getCurrentParameters();
+ strncpy((char *)&params->seq1, seq1, 12);
+ strncpy((char *)&params->seq2, seq2, 12);
+ params->param7 = param7;
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T>
+ void setupIS(const char *name, uint index, T param1, const char *seq) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%d, %s)", name, param1, seq);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersISII>();
+
+ EntityData::EntityParametersISII *params = (EntityData::EntityParametersISII*)_data->getCurrentParameters();
+ params->param1 = (unsigned int)param1;
+ strncpy((char *)&params->seq, seq, 12);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T>
+ void setupISS(const char *name, uint index, T param1, const char *seq1, const char *seq2) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%d, %s, %s)", name, param1, seq1, seq2);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersISSI>();
+
+ EntityData::EntityParametersISSI *params = (EntityData::EntityParametersISSI*)_data->getCurrentParameters();
+ params->param1 = param1;
+ strncpy((char *)&params->seq1, seq1, 12);
+ strncpy((char *)&params->seq2, seq2, 12);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T1, typename T2>
+ void setupIIS(const char *name, uint index, T1 param1, T2 param2, const char *seq) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%d, %d, %s)", name, param1, param2, seq);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersIISI>();
+
+ EntityData::EntityParametersIISI *params = (EntityData::EntityParametersIISI*)_data->getCurrentParameters();
+ params->param1 = param1;
+ params->param2 = param2;
+ strncpy((char *)&params->seq, seq, 12);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ template<typename T1, typename T2>
+ void setupIISS(const char *name, uint index, T1 param1, T2 param2, const char *seq1, const char *seq2) {
+ debugC(6, kLastExpressDebugLogic, "Entity: %s(%d, %d, %s, %s)", name, param1, param2, seq1, seq2);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->setCallback(_entityIndex, _callbacks[index]);
+ _data->setCurrentCallback(index);
+ _data->resetCurrentParameters<EntityData::EntityParametersIISS>();
+
+ EntityData::EntityParametersIISS *params = (EntityData::EntityParametersIISS*)_data->getCurrentParameters();
+ params->param1 = param1;
+ params->param2 = param2;
+ strncpy((char *)&params->seq1, seq1, 12);
+ strncpy((char *)&params->seq2, seq2, 12);
+
+ _engine->getGameLogic()->getGameState()->getGameSavePoints()->call(_entityIndex, _entityIndex, kActionDefault);
+ }
+
+ //////////////////////////////////////////////////////////////////////////
// Helper functions
//////////////////////////////////////////////////////////////////////////