author | truelight |
Fri, 04 May 2007 19:55:35 +0000 | |
branch | noai |
changeset 9614 | 814c3bbf8ecc |
parent 9613 | 5dedb2fa1ab0 |
child 9615 | f809cdc8e360 |
--- a/bin/ai/regression/regression.nut Fri May 04 16:02:34 2007 +0000 +++ b/bin/ai/regression/regression.nut Fri May 04 19:55:35 2007 +0000 @@ -460,6 +460,52 @@ print(" Should be: " + (bank - bank_after)); print(" CloneVehicle(): " + vehicle.CloneVehicle(33417, 1024, true)); + + local list = AIVehicleList(); + + print(""); + print("--VehicleList--"); + print(" Count(): " + list.Count()); + list.Valuate(AIVehicleListLocation()); + print(" Location ListDump:"); + for (local i = list.Begin(); list.HasNext(); i = list.Next()) { + print(" " + i + " => " + list.GetValue(i)); + } + list.Valuate(AIVehicleListEngineType()); + print(" EngineType ListDump:"); + for (local i = list.Begin(); list.HasNext(); i = list.Next()) { + print(" " + i + " => " + list.GetValue(i)); + } + list.Valuate(AIVehicleListUnitNumber()); + print(" UnitNumber ListDump:"); + for (local i = list.Begin(); list.HasNext(); i = list.Next()) { + print(" " + i + " => " + list.GetValue(i)); + } + list.Valuate(AIVehicleListAge()); + print(" Age ListDump:"); + for (local i = list.Begin(); list.HasNext(); i = list.Next()) { + print(" " + i + " => " + list.GetValue(i)); + } + list.Valuate(AIVehicleListMaxAge()); + print(" MaxAge ListDump:"); + for (local i = list.Begin(); list.HasNext(); i = list.Next()) { + print(" " + i + " => " + list.GetValue(i)); + } + list.Valuate(AIVehicleListAgeLeft()); + print(" AgeLeft ListDump:"); + for (local i = list.Begin(); list.HasNext(); i = list.Next()) { + print(" " + i + " => " + list.GetValue(i)); + } + list.Valuate(AIVehicleListProfitThisYear()); + print(" ProfitThisYear ListDump:"); + for (local i = list.Begin(); list.HasNext(); i = list.Next()) { + print(" " + i + " => " + list.GetValue(i)); + } + list.Valuate(AIVehicleListProfitLastYear()); + print(" ProfitLastYear ListDump:"); + for (local i = list.Begin(); list.HasNext(); i = list.Next()) { + print(" " + i + " => " + list.GetValue(i)); + } }
--- a/bin/ai/regression/regression.txt Fri May 04 16:02:34 2007 +0000 +++ b/bin/ai/regression/regression.txt Fri May 04 19:55:35 2007 +0000 @@ -1574,6 +1574,33 @@ Should be: -5945 CloneVehicle(): 1025 +--VehicleList-- + Count(): 2 + Location ListDump: + 1025 => 33417 + 1024 => 33417 + EngineType ListDump: + 1025 => 153 + 1024 => 153 + UnitNumber ListDump: + 1025 => 2 + 1024 => 1 + Age ListDump: + 1024 => 1 + 1025 => 0 + MaxAge ListDump: + 1025 => 5490 + 1024 => 5490 + AgeLeft ListDump: + 1025 => 5490 + 1024 => 5489 + ProfitThisYear ListDump: + 1025 => 0 + 1024 => 0 + ProfitLastYear ListDump: + 1025 => 0 + 1024 => 0 + --Order-- GetNumberOfOrders(): 0 GetOrderDestination(): -1
--- a/source.list Fri May 04 16:02:34 2007 +0000 +++ b/source.list Fri May 04 19:55:35 2007 +0000 @@ -337,6 +337,8 @@ ai/api/ai_townlist_valuator.hpp ai/api/ai_transactionmode.hpp ai/api/ai_vehicle.hpp +ai/api/ai_vehiclelist.hpp +ai/api/ai_vehiclelist_valuator.hpp # AI API Implementation ai/api/ai_abstractlist.cpp @@ -362,6 +364,8 @@ ai/api/ai_townlist_valuator.cpp ai/api/ai_transactionmode.cpp ai/api/ai_vehicle.cpp +ai/api/ai_vehiclelist.cpp +ai/api/ai_vehiclelist_valuator.cpp # NewGRF newgrf.cpp
--- a/src/ai/ai_squirrel.cpp Fri May 04 16:02:34 2007 +0000 +++ b/src/ai/ai_squirrel.cpp Fri May 04 19:55:35 2007 +0000 @@ -43,6 +43,8 @@ #include "api/ai_townlist_valuator.hpp.sq" #include "api/ai_transactionmode.hpp.sq" #include "api/ai_vehicle.hpp.sq" +#include "api/ai_vehiclelist.hpp.sq" +#include "api/ai_vehiclelist_valuator.hpp.sq" static FSquirrel iFSquirrel; ///< Tell the AI-core that we have an AI with which we like to play. @@ -221,6 +223,15 @@ SQAITownListRegister(this->engine); SQAITownRegister(this->engine); SQAITransactionModeRegister(this->engine); + SQAIVehicleListAgeLeftRegister(this->engine); + SQAIVehicleListAgeRegister(this->engine); + SQAIVehicleListEngineTypeRegister(this->engine); + SQAIVehicleListLocationRegister(this->engine); + SQAIVehicleListMaxAgeRegister(this->engine); + SQAIVehicleListProfitLastYearRegister(this->engine); + SQAIVehicleListProfitThisYearRegister(this->engine); + SQAIVehicleListRegister(this->engine); + SQAIVehicleListUnitNumberRegister(this->engine); SQAIVehicleRegister(this->engine); this->engine->SetGlobalPointer(this->engine);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ai/api/ai_vehiclelist.cpp Fri May 04 19:55:35 2007 +0000 @@ -0,0 +1,12 @@ +#include "ai_vehiclelist.hpp" +#include "../../player.h" +#include "../../vehicle.h" + +AIVehicleList::AIVehicleList() +{ + Vehicle *v; + FOR_ALL_VEHICLES(v) { + if (v->owner == _current_player && v->first == NULL) + this->AddItem(v->index); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ai/api/ai_vehiclelist.hpp Fri May 04 19:55:35 2007 +0000 @@ -0,0 +1,26 @@ +/* $Id$ */ + +/** @file ai_vehiclelist.hpp list all the vehicles (you own) */ + +#ifndef AI_VEHICLELIST_HPP +#define AI_VEHICLELIST_HPP + +#include "ai_abstractlist.hpp" + +/** + * Class that creates a list of vehicles you own. + */ +class AIVehicleList : public AIAbstractList { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AIVehicleList"; } + + /** + * The constructor to make a list of towns. + */ + AIVehicleList(); +}; + +#endif /* AI_VEHICLELIST_HPP */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ai/api/ai_vehiclelist.hpp.sq Fri May 04 19:55:35 2007 +0000 @@ -0,0 +1,19 @@ +#include "ai_vehiclelist.hpp" + +namespace SQConvert { + /* Allow AIVehicleList to be used as Squirrel parameter */ + template <> AIVehicleList *GetParam(ForceType<AIVehicleList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleList *)instance; } + template <> AIVehicleList &GetParam(ForceType<AIVehicleList &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleList *)instance; } + template <> const AIVehicleList *GetParam(ForceType<const AIVehicleList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleList *)instance; } + template <> const AIVehicleList &GetParam(ForceType<const AIVehicleList &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleList *)instance; } +}; // namespace SQConvert + +void SQAIVehicleListRegister(Squirrel *engine) { + DefSQClass <AIVehicleList> SQAIVehicleList("AIVehicleList"); + SQAIVehicleList.PreRegister(engine, "AIAbstractList"); + SQAIVehicleList.AddConstructor<void (AIVehicleList::*)()>(engine, 1, "x"); + + SQAIVehicleList.DefSQStaticMethod(engine, &AIVehicleList::GetClassName, "GetClassName", 1, "x"); + + SQAIVehicleList.PostRegister(engine); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ai/api/ai_vehiclelist_valuator.cpp Fri May 04 19:55:35 2007 +0000 @@ -0,0 +1,50 @@ +#include "ai_vehiclelist_valuator.hpp" +#include "../../vehicle.h" + +int32 AIVehicleListLocation::Valuate(int32 vehicle) const +{ + if (!IsValidVehicleID(vehicle)) return 0; + return GetVehicle(vehicle)->tile; +} + +int32 AIVehicleListEngineType::Valuate(int32 vehicle) const +{ + if (!IsValidVehicleID(vehicle)) return 0; + return GetVehicle(vehicle)->engine_type; +} + +int32 AIVehicleListUnitNumber::Valuate(int32 vehicle) const +{ + if (!IsValidVehicleID(vehicle)) return 0; + return GetVehicle(vehicle)->unitnumber; +} + +int32 AIVehicleListAge::Valuate(int32 vehicle) const +{ + if (!IsValidVehicleID(vehicle)) return 0; + return GetVehicle(vehicle)->age; +} + +int32 AIVehicleListMaxAge::Valuate(int32 vehicle) const +{ + if (!IsValidVehicleID(vehicle)) return 0; + return GetVehicle(vehicle)->max_age; +} + +int32 AIVehicleListAgeLeft::Valuate(int32 vehicle) const +{ + if (!IsValidVehicleID(vehicle)) return 0; + return GetVehicle(vehicle)->max_age - GetVehicle(vehicle)->age; +} + +int32 AIVehicleListProfitThisYear::Valuate(int32 vehicle) const +{ + if (!IsValidVehicleID(vehicle)) return 0; + return GetVehicle(vehicle)->profit_this_year; +} + +int32 AIVehicleListProfitLastYear::Valuate(int32 vehicle) const +{ + if (!IsValidVehicleID(vehicle)) return 0; + return GetVehicle(vehicle)->profit_last_year; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ai/api/ai_vehiclelist_valuator.hpp Fri May 04 19:55:35 2007 +0000 @@ -0,0 +1,139 @@ +/* $Id$ */ + +/** @file ai_vehiclelist_valuator.hpp all the valuators for vehiclelist */ + +#ifndef AI_VEHICLELIST_VALUATOR_HPP +#define AI_VEHICLELIST_VALUATOR_HPP + +#include "ai_abstractlist.hpp" + +/** + * Get the location for entries in an AIVehicleList instance. + * @note resulting items are of the type TileIndex + * @note the input items are of the type VehicleID + */ +class AIVehicleListLocation : public AIAbstractList::Valuator { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AIVehicleListGetLocation"; } + +private: + int32 Valuate(int32 town) const; +}; + +/** + * Get the engine-type for entries in an AIVehicleList instance. + * @note resulting items are of the type EngineID + * @note the input items are of the type VehicleID + */ +class AIVehicleListEngineType : public AIAbstractList::Valuator { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AIVehicleListEngineType"; } + +private: + int32 Valuate(int32 town) const; +}; + +/** + * Get the unit number for entries in an AIVehicleList instance. + * @note resulting items are of the type int32 + * @note the input items are of the type VehicleID + */ +class AIVehicleListUnitNumber : public AIAbstractList::Valuator { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AIVehicleListUnitNumber"; } + +private: + int32 Valuate(int32 town) const; +}; + +/** + * Get the age for entries in an AIVehicleList instance. + * @note resulting items are of the type int32 (age in days) + * @note the input items are of the type VehicleID + */ +class AIVehicleListAge : public AIAbstractList::Valuator { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AIVehicleListAge"; } + +private: + int32 Valuate(int32 town) const; +}; + +/** + * Get the max age for entries in an AIVehicleList instance. + * @note resulting items are of the type int32 (age in days) + * @note the input items are of the type VehicleID + */ +class AIVehicleListMaxAge : public AIAbstractList::Valuator { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AIVehicleListMaxAge"; } + +private: + int32 Valuate(int32 town) const; +}; + +/** + * Get the age left for the vehicle gets 'old' for entries in an AIVehicleList instance. + * @note resulting items are of the type int32 (age in days) + * @note the input items are of the type VehicleID + */ +class AIVehicleListAgeLeft : public AIAbstractList::Valuator { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AIVehicleListAgeLeft"; } + +private: + int32 Valuate(int32 town) const; +}; + +/** + * Get the profit of this year for entries in an AIVehicleList instance. + * @note resulting items are of the type int32 (age in days) + * @note the input items are of the type VehicleID + */ +class AIVehicleListProfitThisYear : public AIAbstractList::Valuator { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AIVehicleListProfitThisYear"; } + +private: + int32 Valuate(int32 town) const; +}; + +/** + * Get the profit of last year for entries in an AIVehicleList instance. + * @note resulting items are of the type int32 (age in days) + * @note the input items are of the type VehicleID + */ +class AIVehicleListProfitLastYear : public AIAbstractList::Valuator { +public: + /** + * The name of the class, needed by several sub-processes. + */ + static const char *GetClassName() { return "AIVehicleListProfitLastYear"; } + +private: + int32 Valuate(int32 town) const; +}; + + +#endif /* AI_VEHICLELIST_VALUATOR_HPP */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ai/api/ai_vehiclelist_valuator.hpp.sq Fri May 04 19:55:35 2007 +0000 @@ -0,0 +1,145 @@ +#include "ai_vehiclelist_valuator.hpp" + +namespace SQConvert { + /* Allow AIVehicleListLocation to be used as Squirrel parameter */ + template <> AIVehicleListLocation *GetParam(ForceType<AIVehicleListLocation *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListLocation *)instance; } + template <> AIVehicleListLocation &GetParam(ForceType<AIVehicleListLocation &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListLocation *)instance; } + template <> const AIVehicleListLocation *GetParam(ForceType<const AIVehicleListLocation *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListLocation *)instance; } + template <> const AIVehicleListLocation &GetParam(ForceType<const AIVehicleListLocation &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListLocation *)instance; } +}; // namespace SQConvert + +void SQAIVehicleListLocationRegister(Squirrel *engine) { + DefSQClass <AIVehicleListLocation> SQAIVehicleListLocation("AIVehicleListLocation"); + SQAIVehicleListLocation.PreRegister(engine); + SQAIVehicleListLocation.AddConstructor<void (AIVehicleListLocation::*)()>(engine, 1, "x"); + + SQAIVehicleListLocation.DefSQStaticMethod(engine, &AIVehicleListLocation::GetClassName, "GetClassName", 1, "x"); + + SQAIVehicleListLocation.PostRegister(engine); +} + +namespace SQConvert { + /* Allow AIVehicleListEngineType to be used as Squirrel parameter */ + template <> AIVehicleListEngineType *GetParam(ForceType<AIVehicleListEngineType *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListEngineType *)instance; } + template <> AIVehicleListEngineType &GetParam(ForceType<AIVehicleListEngineType &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListEngineType *)instance; } + template <> const AIVehicleListEngineType *GetParam(ForceType<const AIVehicleListEngineType *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListEngineType *)instance; } + template <> const AIVehicleListEngineType &GetParam(ForceType<const AIVehicleListEngineType &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListEngineType *)instance; } +}; // namespace SQConvert + +void SQAIVehicleListEngineTypeRegister(Squirrel *engine) { + DefSQClass <AIVehicleListEngineType> SQAIVehicleListEngineType("AIVehicleListEngineType"); + SQAIVehicleListEngineType.PreRegister(engine); + SQAIVehicleListEngineType.AddConstructor<void (AIVehicleListEngineType::*)()>(engine, 1, "x"); + + SQAIVehicleListEngineType.DefSQStaticMethod(engine, &AIVehicleListEngineType::GetClassName, "GetClassName", 1, "x"); + + SQAIVehicleListEngineType.PostRegister(engine); +} + +namespace SQConvert { + /* Allow AIVehicleListUnitNumber to be used as Squirrel parameter */ + template <> AIVehicleListUnitNumber *GetParam(ForceType<AIVehicleListUnitNumber *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListUnitNumber *)instance; } + template <> AIVehicleListUnitNumber &GetParam(ForceType<AIVehicleListUnitNumber &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListUnitNumber *)instance; } + template <> const AIVehicleListUnitNumber *GetParam(ForceType<const AIVehicleListUnitNumber *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListUnitNumber *)instance; } + template <> const AIVehicleListUnitNumber &GetParam(ForceType<const AIVehicleListUnitNumber &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListUnitNumber *)instance; } +}; // namespace SQConvert + +void SQAIVehicleListUnitNumberRegister(Squirrel *engine) { + DefSQClass <AIVehicleListUnitNumber> SQAIVehicleListUnitNumber("AIVehicleListUnitNumber"); + SQAIVehicleListUnitNumber.PreRegister(engine); + SQAIVehicleListUnitNumber.AddConstructor<void (AIVehicleListUnitNumber::*)()>(engine, 1, "x"); + + SQAIVehicleListUnitNumber.DefSQStaticMethod(engine, &AIVehicleListUnitNumber::GetClassName, "GetClassName", 1, "x"); + + SQAIVehicleListUnitNumber.PostRegister(engine); +} + +namespace SQConvert { + /* Allow AIVehicleListAge to be used as Squirrel parameter */ + template <> AIVehicleListAge *GetParam(ForceType<AIVehicleListAge *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListAge *)instance; } + template <> AIVehicleListAge &GetParam(ForceType<AIVehicleListAge &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListAge *)instance; } + template <> const AIVehicleListAge *GetParam(ForceType<const AIVehicleListAge *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListAge *)instance; } + template <> const AIVehicleListAge &GetParam(ForceType<const AIVehicleListAge &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListAge *)instance; } +}; // namespace SQConvert + +void SQAIVehicleListAgeRegister(Squirrel *engine) { + DefSQClass <AIVehicleListAge> SQAIVehicleListAge("AIVehicleListAge"); + SQAIVehicleListAge.PreRegister(engine); + SQAIVehicleListAge.AddConstructor<void (AIVehicleListAge::*)()>(engine, 1, "x"); + + SQAIVehicleListAge.DefSQStaticMethod(engine, &AIVehicleListAge::GetClassName, "GetClassName", 1, "x"); + + SQAIVehicleListAge.PostRegister(engine); +} + +namespace SQConvert { + /* Allow AIVehicleListMaxAge to be used as Squirrel parameter */ + template <> AIVehicleListMaxAge *GetParam(ForceType<AIVehicleListMaxAge *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListMaxAge *)instance; } + template <> AIVehicleListMaxAge &GetParam(ForceType<AIVehicleListMaxAge &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListMaxAge *)instance; } + template <> const AIVehicleListMaxAge *GetParam(ForceType<const AIVehicleListMaxAge *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListMaxAge *)instance; } + template <> const AIVehicleListMaxAge &GetParam(ForceType<const AIVehicleListMaxAge &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListMaxAge *)instance; } +}; // namespace SQConvert + +void SQAIVehicleListMaxAgeRegister(Squirrel *engine) { + DefSQClass <AIVehicleListMaxAge> SQAIVehicleListMaxAge("AIVehicleListMaxAge"); + SQAIVehicleListMaxAge.PreRegister(engine); + SQAIVehicleListMaxAge.AddConstructor<void (AIVehicleListMaxAge::*)()>(engine, 1, "x"); + + SQAIVehicleListMaxAge.DefSQStaticMethod(engine, &AIVehicleListMaxAge::GetClassName, "GetClassName", 1, "x"); + + SQAIVehicleListMaxAge.PostRegister(engine); +} + +namespace SQConvert { + /* Allow AIVehicleListAgeLeft to be used as Squirrel parameter */ + template <> AIVehicleListAgeLeft *GetParam(ForceType<AIVehicleListAgeLeft *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListAgeLeft *)instance; } + template <> AIVehicleListAgeLeft &GetParam(ForceType<AIVehicleListAgeLeft &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListAgeLeft *)instance; } + template <> const AIVehicleListAgeLeft *GetParam(ForceType<const AIVehicleListAgeLeft *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListAgeLeft *)instance; } + template <> const AIVehicleListAgeLeft &GetParam(ForceType<const AIVehicleListAgeLeft &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListAgeLeft *)instance; } +}; // namespace SQConvert + +void SQAIVehicleListAgeLeftRegister(Squirrel *engine) { + DefSQClass <AIVehicleListAgeLeft> SQAIVehicleListAgeLeft("AIVehicleListAgeLeft"); + SQAIVehicleListAgeLeft.PreRegister(engine); + SQAIVehicleListAgeLeft.AddConstructor<void (AIVehicleListAgeLeft::*)()>(engine, 1, "x"); + + SQAIVehicleListAgeLeft.DefSQStaticMethod(engine, &AIVehicleListAgeLeft::GetClassName, "GetClassName", 1, "x"); + + SQAIVehicleListAgeLeft.PostRegister(engine); +} + +namespace SQConvert { + /* Allow AIVehicleListProfitThisYear to be used as Squirrel parameter */ + template <> AIVehicleListProfitThisYear *GetParam(ForceType<AIVehicleListProfitThisYear *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListProfitThisYear *)instance; } + template <> AIVehicleListProfitThisYear &GetParam(ForceType<AIVehicleListProfitThisYear &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListProfitThisYear *)instance; } + template <> const AIVehicleListProfitThisYear *GetParam(ForceType<const AIVehicleListProfitThisYear *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListProfitThisYear *)instance; } + template <> const AIVehicleListProfitThisYear &GetParam(ForceType<const AIVehicleListProfitThisYear &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListProfitThisYear *)instance; } +}; // namespace SQConvert + +void SQAIVehicleListProfitThisYearRegister(Squirrel *engine) { + DefSQClass <AIVehicleListProfitThisYear> SQAIVehicleListProfitThisYear("AIVehicleListProfitThisYear"); + SQAIVehicleListProfitThisYear.PreRegister(engine); + SQAIVehicleListProfitThisYear.AddConstructor<void (AIVehicleListProfitThisYear::*)()>(engine, 1, "x"); + + SQAIVehicleListProfitThisYear.DefSQStaticMethod(engine, &AIVehicleListProfitThisYear::GetClassName, "GetClassName", 1, "x"); + + SQAIVehicleListProfitThisYear.PostRegister(engine); +} + +namespace SQConvert { + /* Allow AIVehicleListProfitLastYear to be used as Squirrel parameter */ + template <> AIVehicleListProfitLastYear *GetParam(ForceType<AIVehicleListProfitLastYear *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListProfitLastYear *)instance; } + template <> AIVehicleListProfitLastYear &GetParam(ForceType<AIVehicleListProfitLastYear &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListProfitLastYear *)instance; } + template <> const AIVehicleListProfitLastYear *GetParam(ForceType<const AIVehicleListProfitLastYear *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleListProfitLastYear *)instance; } + template <> const AIVehicleListProfitLastYear &GetParam(ForceType<const AIVehicleListProfitLastYear &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleListProfitLastYear *)instance; } +}; // namespace SQConvert + +void SQAIVehicleListProfitLastYearRegister(Squirrel *engine) { + DefSQClass <AIVehicleListProfitLastYear> SQAIVehicleListProfitLastYear("AIVehicleListProfitLastYear"); + SQAIVehicleListProfitLastYear.PreRegister(engine); + SQAIVehicleListProfitLastYear.AddConstructor<void (AIVehicleListProfitLastYear::*)()>(engine, 1, "x"); + + SQAIVehicleListProfitLastYear.DefSQStaticMethod(engine, &AIVehicleListProfitLastYear::GetClassName, "GetClassName", 1, "x"); + + SQAIVehicleListProfitLastYear.PostRegister(engine); +}