summaryrefslogtreecommitdiff
path: root/src/script/api/template
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-05-26 14:16:32 +0000
committerfrosch <frosch@openttd.org>2012-05-26 14:16:32 +0000
commit66a37e28a69411f4666158cce03c6fd29e9a15e1 (patch)
tree5735dafdf64c8ea7e57c1b9592f256ff37ccd687 /src/script/api/template
parent9ad9d72c4ae6fb28e7381bbd50ddeb2502b7d925 (diff)
downloadopenttd-66a37e28a69411f4666158cce03c6fd29e9a15e1.tar.xz
(svn r24289) -Add: [Script] Base class for script events involving a company and a town.
Diffstat (limited to 'src/script/api/template')
-rw-r--r--src/script/api/template/template_event_types.hpp.sq9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script/api/template/template_event_types.hpp.sq b/src/script/api/template/template_event_types.hpp.sq
index e03e7df3d..ae045a092 100644
--- a/src/script/api/template/template_event_types.hpp.sq
+++ b/src/script/api/template/template_event_types.hpp.sq
@@ -239,3 +239,12 @@ namespace SQConvert {
template <> inline const ScriptEventGoalQuestionAnswer &GetParam(ForceType<const ScriptEventGoalQuestionAnswer &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEventGoalQuestionAnswer *)instance; }
template <> inline int Return<ScriptEventGoalQuestionAnswer *>(HSQUIRRELVM vm, ScriptEventGoalQuestionAnswer *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "EventGoalQuestionAnswer", res, NULL, DefSQDestructorCallback<ScriptEventGoalQuestionAnswer>, true); return 1; }
} // namespace SQConvert
+
+namespace SQConvert {
+ /* Allow ScriptEventCompanyTown to be used as Squirrel parameter */
+ template <> inline ScriptEventCompanyTown *GetParam(ForceType<ScriptEventCompanyTown *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptEventCompanyTown *)instance; }
+ template <> inline ScriptEventCompanyTown &GetParam(ForceType<ScriptEventCompanyTown &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEventCompanyTown *)instance; }
+ template <> inline const ScriptEventCompanyTown *GetParam(ForceType<const ScriptEventCompanyTown *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptEventCompanyTown *)instance; }
+ template <> inline const ScriptEventCompanyTown &GetParam(ForceType<const ScriptEventCompanyTown &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEventCompanyTown *)instance; }
+ template <> inline int Return<ScriptEventCompanyTown *>(HSQUIRRELVM vm, ScriptEventCompanyTown *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "EventCompanyTown", res, NULL, DefSQDestructorCallback<ScriptEventCompanyTown>, true); return 1; }
+} // namespace SQConvert