src/ai/api/ai_airport.hpp.sq
author truebrain
Sun, 08 Jun 2008 21:20:48 +0000
branchnoai
changeset 10871 326ee226e9d7
parent 10734 06f95974ac15
permissions -rw-r--r--
(svn r13422) [NoAI] -Change [API CHANGE]: remove Stop() as part of the AIController. This means you no longer need to have a Stop() function in your AI, nor is it ever called. This because it was silly, never used, and couldn't do anything real (all Sleep/DoCommands resulted in an assert, as the game expected the company to be gone).
10212
1e0a2a182253 (svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents: 9839
diff changeset
     1
/* $Id$ */
1e0a2a182253 (svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents: 9839
diff changeset
     2
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
1e0a2a182253 (svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents: 9839
diff changeset
     3
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     4
#include "ai_airport.hpp"
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     5
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     6
namespace SQConvert {
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     7
	/* Allow enums to be used as Squirrel parameters */
10734
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
     8
	template <> AIAirport::AirportType GetParam(ForceType<AIAirport::AirportType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIAirport::AirportType)tmp; }
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
     9
	template <> int Return<AIAirport::AirportType>(HSQUIRRELVM vm, AIAirport::AirportType res) { sq_pushinteger(vm, (int32)res); return 1; }
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    10
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    11
	/* Allow AIAirport to be used as Squirrel parameter */
10734
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    12
	template <> AIAirport *GetParam(ForceType<AIAirport *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIAirport *)instance; }
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    13
	template <> AIAirport &GetParam(ForceType<AIAirport &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAirport *)instance; }
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    14
	template <> const AIAirport *GetParam(ForceType<const AIAirport *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIAirport *)instance; }
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    15
	template <> const AIAirport &GetParam(ForceType<const AIAirport &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAirport *)instance; }
9680
5ed7bbfd51c7 (svn r10629) [NoAI] -Fix: on returning a class instance which is NULL, do not make a wrapper SQ, but return a NULL pointer too
truelight
parents: 9679
diff changeset
    16
	template <> int Return<AIAirport *>(HSQUIRRELVM vm, AIAirport *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIAirport", res, NULL, DefSQDestructorCallback<AIAirport>); return 1; }
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    17
}; // namespace SQConvert
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    18
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9737
diff changeset
    19
void SQAIAirport_Register(Squirrel *engine) {
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    20
	DefSQClass <AIAirport> SQAIAirport("AIAirport");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    21
	SQAIAirport.PreRegister(engine);
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    22
	SQAIAirport.AddConstructor<void (AIAirport::*)(), 1>(engine, "x");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    23
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    24
	SQAIAirport.DefSQConst(engine, AIAirport::AT_SMALL,         "AT_SMALL");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    25
	SQAIAirport.DefSQConst(engine, AIAirport::AT_LARGE,         "AT_LARGE");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    26
	SQAIAirport.DefSQConst(engine, AIAirport::AT_METROPOLITAN,  "AT_METROPOLITAN");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    27
	SQAIAirport.DefSQConst(engine, AIAirport::AT_INTERNATIONAL, "AT_INTERNATIONAL");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    28
	SQAIAirport.DefSQConst(engine, AIAirport::AT_COMMUTER,      "AT_COMMUTER");
9839
ea94d60d13e7 (svn r12505) [NoAI] -Documentation: still forgot some files ;) (minor stuff, capitals mostly)
truebrain
parents: 9829
diff changeset
    29
	SQAIAirport.DefSQConst(engine, AIAirport::AT_INTERCON,      "AT_INTERCON");
ea94d60d13e7 (svn r12505) [NoAI] -Documentation: still forgot some files ;) (minor stuff, capitals mostly)
truebrain
parents: 9829
diff changeset
    30
	SQAIAirport.DefSQConst(engine, AIAirport::AT_HELIPORT,      "AT_HELIPORT");
ea94d60d13e7 (svn r12505) [NoAI] -Documentation: still forgot some files ;) (minor stuff, capitals mostly)
truebrain
parents: 9829
diff changeset
    31
	SQAIAirport.DefSQConst(engine, AIAirport::AT_HELISTATION,   "AT_HELISTATION");
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    32
	SQAIAirport.DefSQConst(engine, AIAirport::AT_HELIDEPOT,     "AT_HELIDEPOT");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    33
9670
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9654
diff changeset
    34
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetClassName,             "GetClassName",             1, "x");
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9654
diff changeset
    35
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsHangarTile,             "IsHangarTile",             2, "xi");
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9654
diff changeset
    36
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::IsAirportTile,            "IsAirportTile",            2, "xi");
9773
d2c20cd38f18 (svn r12266) [NoAI] -Fix: [API CHANGE] minor typo in Ai*r*portAvailable (tnx yorick)
truebrain
parents: 9741
diff changeset
    37
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::AirportAvailable,         "AirportAvailable",         2, "xi");
9670
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9654
diff changeset
    38
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportWidth,          "GetAirportWidth",          2, "xi");
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9654
diff changeset
    39
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportHeight,         "GetAirportHeight",         2, "xi");
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9654
diff changeset
    40
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetAirportCoverageRadius, "GetAirportCoverageRadius", 2, "xi");
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9773
diff changeset
    41
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::GetHangarOfAirport,       "GetHangarOfAirport",       2, "xi");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    42
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::BuildAirport,             "BuildAirport",             3, "xii");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    43
	SQAIAirport.DefSQStaticMethod(engine, &AIAirport::RemoveAirport,            "RemoveAirport",            2, "xi");
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    44
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    45
	SQAIAirport.PostRegister(engine);
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
diff changeset
    46
}