summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_vehiclelist.hpp.sq
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-09 09:46:08 +0000
committerrubidium <rubidium@openttd.org>2009-09-09 09:46:08 +0000
commitf3f6eaa6dc715531cbf92ff84e175e5add3a4688 (patch)
tree0d189d038d80dc1e1467c6d85d86482dcd2d10fb /src/ai/api/ai_vehiclelist.hpp.sq
parentf1cc044a4021362f1826378b129ecef1210a6a0d (diff)
downloadopenttd-f3f6eaa6dc715531cbf92ff84e175e5add3a4688.tar.xz
(svn r17486) -Add [NoAI]: a vehicle list for all vehicle that are ordered to a specific depot
Diffstat (limited to 'src/ai/api/ai_vehiclelist.hpp.sq')
-rw-r--r--src/ai/api/ai_vehiclelist.hpp.sq17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ai/api/ai_vehiclelist.hpp.sq b/src/ai/api/ai_vehiclelist.hpp.sq
index 68cb3cf41..1e7817cdf 100644
--- a/src/ai/api/ai_vehiclelist.hpp.sq
+++ b/src/ai/api/ai_vehiclelist.hpp.sq
@@ -46,6 +46,23 @@ void SQAIVehicleList_Station_Register(Squirrel *engine) {
}
namespace SQConvert {
+ /* Allow AIVehicleList_Depot to be used as Squirrel parameter */
+ template <> AIVehicleList_Depot *GetParam(ForceType<AIVehicleList_Depot *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleList_Depot *)instance; }
+ template <> AIVehicleList_Depot &GetParam(ForceType<AIVehicleList_Depot &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleList_Depot *)instance; }
+ template <> const AIVehicleList_Depot *GetParam(ForceType<const AIVehicleList_Depot *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleList_Depot *)instance; }
+ template <> const AIVehicleList_Depot &GetParam(ForceType<const AIVehicleList_Depot &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleList_Depot *)instance; }
+ template <> int Return<AIVehicleList_Depot *>(HSQUIRRELVM vm, AIVehicleList_Depot *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIVehicleList_Depot", res, NULL, DefSQDestructorCallback<AIVehicleList_Depot>); return 1; }
+}; // namespace SQConvert
+
+void SQAIVehicleList_Depot_Register(Squirrel *engine) {
+ DefSQClass <AIVehicleList_Depot> SQAIVehicleList_Depot("AIVehicleList_Depot");
+ SQAIVehicleList_Depot.PreRegister(engine, "AIAbstractList");
+ SQAIVehicleList_Depot.AddConstructor<void (AIVehicleList_Depot::*)(TileIndex tile), 2>(engine, "xi");
+
+ SQAIVehicleList_Depot.PostRegister(engine);
+}
+
+namespace SQConvert {
/* Allow AIVehicleList_SharedOrders to be used as Squirrel parameter */
template <> AIVehicleList_SharedOrders *GetParam(ForceType<AIVehicleList_SharedOrders *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleList_SharedOrders *)instance; }
template <> AIVehicleList_SharedOrders &GetParam(ForceType<AIVehicleList_SharedOrders &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleList_SharedOrders *)instance; }