diff options
author | truebrain <truebrain@openttd.org> | 2011-12-19 20:50:54 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-19 20:50:54 +0000 |
commit | 12aa5b6a583aa7ca9092ec6c77e7b12677cdd6a4 (patch) | |
tree | 7569f15cf65bf42fc1b4fff16a66cba8d0648299 /src/script/api/game/game_event.hpp.sq | |
parent | 5cda1d7c90f7ac2a1d8a851edbe426f07a032946 (diff) | |
download | openttd-12aa5b6a583aa7ca9092ec6c77e7b12677cdd6a4.tar.xz |
(svn r23604) -Add: initial support for GameScripts
Diffstat (limited to 'src/script/api/game/game_event.hpp.sq')
-rw-r--r-- | src/script/api/game/game_event.hpp.sq | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/script/api/game/game_event.hpp.sq b/src/script/api/game/game_event.hpp.sq new file mode 100644 index 000000000..5f87970f6 --- /dev/null +++ b/src/script/api/game/game_event.hpp.sq @@ -0,0 +1,67 @@ +/* $Id$ */ + +/* + * This file is part of OpenTTD. + * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. + */ + +/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */ + +#include "../script_event.hpp" +#include "../template/template_event.hpp.sq" + + +template <> const char *GetClassName<ScriptEvent, ST_GS>() { return "GSEvent"; } + +void SQGSEvent_Register(Squirrel *engine) +{ + DefSQClass<ScriptEvent, ST_GS> SQGSEvent("GSEvent"); + SQGSEvent.PreRegister(engine); + SQGSEvent.AddConstructor<void (ScriptEvent::*)(ScriptEvent::ScriptEventType type), 2>(engine, "xi"); + + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_INVALID, "ET_INVALID"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_TEST, "ET_TEST"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_SUBSIDY_OFFER, "ET_SUBSIDY_OFFER"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_SUBSIDY_OFFER_EXPIRED, "ET_SUBSIDY_OFFER_EXPIRED"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_SUBSIDY_AWARDED, "ET_SUBSIDY_AWARDED"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_SUBSIDY_EXPIRED, "ET_SUBSIDY_EXPIRED"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_ENGINE_PREVIEW, "ET_ENGINE_PREVIEW"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_COMPANY_NEW, "ET_COMPANY_NEW"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_COMPANY_IN_TROUBLE, "ET_COMPANY_IN_TROUBLE"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_COMPANY_ASK_MERGER, "ET_COMPANY_ASK_MERGER"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_COMPANY_MERGER, "ET_COMPANY_MERGER"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_COMPANY_BANKRUPT, "ET_COMPANY_BANKRUPT"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_VEHICLE_CRASHED, "ET_VEHICLE_CRASHED"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_VEHICLE_LOST, "ET_VEHICLE_LOST"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_VEHICLE_WAITING_IN_DEPOT, "ET_VEHICLE_WAITING_IN_DEPOT"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_VEHICLE_UNPROFITABLE, "ET_VEHICLE_UNPROFITABLE"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_INDUSTRY_OPEN, "ET_INDUSTRY_OPEN"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_INDUSTRY_CLOSE, "ET_INDUSTRY_CLOSE"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_ENGINE_AVAILABLE, "ET_ENGINE_AVAILABLE"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_STATION_FIRST_VEHICLE, "ET_STATION_FIRST_VEHICLE"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_DISASTER_ZEPPELINER_CRASHED, "ET_DISASTER_ZEPPELINER_CRASHED"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_DISASTER_ZEPPELINER_CLEARED, "ET_DISASTER_ZEPPELINER_CLEARED"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_TOWN_FOUNDED, "ET_TOWN_FOUNDED"); + SQGSEvent.DefSQConst(engine, ScriptEvent::ET_AIRCRAFT_DEST_TOO_FAR, "ET_AIRCRAFT_DEST_TOO_FAR"); + + SQGSEvent.DefSQMethod(engine, &ScriptEvent::GetEventType, "GetEventType", 1, "x"); + + SQGSEvent.PostRegister(engine); +} + + +template <> const char *GetClassName<ScriptEventController, ST_GS>() { return "GSEventController"; } + +void SQGSEventController_Register(Squirrel *engine) +{ + DefSQClass<ScriptEventController, ST_GS> SQGSEventController("GSEventController"); + SQGSEventController.PreRegister(engine); + SQGSEventController.AddConstructor<void (ScriptEventController::*)(), 1>(engine, "x"); + + SQGSEventController.DefSQStaticMethod(engine, &ScriptEventController::IsEventWaiting, "IsEventWaiting", 1, "."); + SQGSEventController.DefSQStaticMethod(engine, &ScriptEventController::GetNextEvent, "GetNextEvent", 1, "."); + + SQGSEventController.PostRegister(engine); +} |