ai_airport_type_list/ 0000755 0001750 0001001 00000000000 11623545247 013641 5 ustar Leif None ai_airport_type_list/p.patch 0000644 0001750 0001001 00000036364 11623545222 015126 0 ustar Leif None Index: src/ai/ai_instance.cpp
===================================================================
--- src/ai/ai_instance.cpp (revision 22713)
+++ src/ai/ai_instance.cpp (working copy)
@@ -25,6 +25,7 @@
* Note: this line a marker in squirrel_export.sh. Do not change! */
#include "api/ai_accounting.hpp.sq"
#include "api/ai_airport.hpp.sq"
+#include "api/ai_airporttypelist.hpp.sq"
#include "api/ai_base.hpp.sq"
#include "api/ai_basestation.hpp.sq"
#include "api/ai_bridge.hpp.sq"
@@ -177,6 +178,7 @@
SQAIList_Register(this->engine);
SQAIAccounting_Register(this->engine);
SQAIAirport_Register(this->engine);
+ SQAIAirportTypeList_Register(this->engine);
SQAIBase_Register(this->engine);
SQAIBaseStation_Register(this->engine);
SQAIBridge_Register(this->engine);
Index: src/ai/api/ai_airporttypelist.hpp.sq
===================================================================
--- src/ai/api/ai_airporttypelist.hpp.sq (revision 0)
+++ src/ai/api/ai_airporttypelist.hpp.sq (revision 0)
@@ -0,0 +1,30 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "ai_airporttypelist.hpp"
+
+namespace SQConvert {
+ /* Allow AIAirportTypeList to be used as Squirrel parameter */
+ template <> AIAirportTypeList *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIAirportTypeList *)instance; }
+ template <> AIAirportTypeList &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAirportTypeList *)instance; }
+ template <> const AIAirportTypeList *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIAirportTypeList *)instance; }
+ template <> const AIAirportTypeList &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAirportTypeList *)instance; }
+ template <> int Return(HSQUIRRELVM vm, AIAirportTypeList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIAirportTypeList", res, NULL, DefSQDestructorCallback); return 1; }
+} // namespace SQConvert
+
+void SQAIAirportTypeList_Register(Squirrel *engine)
+{
+ DefSQClass SQAIAirportTypeList("AIAirportTypeList");
+ SQAIAirportTypeList.PreRegister(engine, "AIList");
+ SQAIAirportTypeList.AddConstructor(engine, "x");
+
+ SQAIAirportTypeList.PostRegister(engine);
+}
Property changes on: src/ai/api/ai_airporttypelist.hpp.sq
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Index: src/ai/api/ai_types.hpp
===================================================================
--- src/ai/api/ai_types.hpp (revision 22713)
+++ src/ai/api/ai_types.hpp (working copy)
@@ -100,6 +100,7 @@
typedef uint32 VehicleID; ///< The ID of a vehicle.
/* Types we defined ourself, as the OpenTTD core doesn't have them (yet) */
+typedef byte AirportType; ///< The ID of an airport type.
typedef uint AIErrorType; ///< The types of errors inside the NoAI framework.
typedef BridgeType BridgeID; ///< The ID of a bridge.
Index: src/ai/api/ai_airport.cpp
===================================================================
--- src/ai/api/ai_airport.cpp (revision 22713)
+++ src/ai/api/ai_airport.cpp (working copy)
@@ -113,7 +113,7 @@
return st->airport.GetHangarTile(0);
}
-/* static */ AIAirport::AirportType AIAirport::GetAirportType(TileIndex tile)
+/* static */ AirportType AIAirport::GetAirportType(TileIndex tile)
{
if (!AITile::IsStationTile(tile)) return AT_INVALID;
Index: src/ai/api/ai_airport.hpp.sq
===================================================================
--- src/ai/api/ai_airport.hpp.sq (revision 22713)
+++ src/ai/api/ai_airport.hpp.sq (working copy)
@@ -13,8 +13,6 @@
namespace SQConvert {
/* Allow enums to be used as Squirrel parameters */
- template <> AIAirport::AirportType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIAirport::AirportType)tmp; }
- template <> int Return(HSQUIRRELVM vm, AIAirport::AirportType res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> AIAirport::PlaneType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIAirport::PlaneType)tmp; }
template <> int Return(HSQUIRRELVM vm, AIAirport::PlaneType res) { sq_pushinteger(vm, (int32)res); return 1; }
@@ -32,16 +30,6 @@
SQAIAirport.PreRegister(engine);
SQAIAirport.AddConstructor(engine, "x");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_SMALL, "AT_SMALL");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_LARGE, "AT_LARGE");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_METROPOLITAN, "AT_METROPOLITAN");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_INTERNATIONAL, "AT_INTERNATIONAL");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_COMMUTER, "AT_COMMUTER");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_INTERCON, "AT_INTERCON");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_HELIPORT, "AT_HELIPORT");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_HELISTATION, "AT_HELISTATION");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_HELIDEPOT, "AT_HELIDEPOT");
- SQAIAirport.DefSQConst(engine, AIAirport::AT_INVALID, "AT_INVALID");
SQAIAirport.DefSQConst(engine, AIAirport::PT_HELICOPTER, "PT_HELICOPTER");
SQAIAirport.DefSQConst(engine, AIAirport::PT_SMALL_PLANE, "PT_SMALL_PLANE");
SQAIAirport.DefSQConst(engine, AIAirport::PT_BIG_PLANE, "PT_BIG_PLANE");
Index: src/ai/api/ai_airport.hpp
===================================================================
--- src/ai/api/ai_airport.hpp (revision 22713)
+++ src/ai/api/ai_airport.hpp (working copy)
@@ -23,26 +23,6 @@
static const char *GetClassName() { return "AIAirport"; }
/**
- * The types of airports available in the game.
- */
- enum AirportType {
- /* Note: the values _are_ important as they represent an in-game value */
- AT_SMALL = 0, ///< The small airport.
- AT_LARGE = 1, ///< The large airport.
- AT_METROPOLITAN = 3, ///< The metropolitan airport.
- AT_INTERNATIONAL = 4, ///< The international airport.
- AT_COMMUTER = 5, ///< The commuter airport.
- AT_INTERCON = 7, ///< The intercontinental airport.
-
- /* Next are the airports which only have helicopter platforms */
- AT_HELIPORT = 2, ///< The heliport.
- AT_HELISTATION = 8, ///< The helistation.
- AT_HELIDEPOT = 6, ///< The helidepot.
-
- AT_INVALID = 255, ///< Invalid airport.
- };
-
- /**
* All plane types available.
*/
enum PlaneType {
Index: projects/openttd_vs80.vcproj
===================================================================
--- projects/openttd_vs80.vcproj (revision 22713)
+++ projects/openttd_vs80.vcproj (working copy)
@@ -2723,6 +2723,10 @@
>
+
+
@@ -2939,6 +2943,10 @@
>
+
+
Index: projects/openttd_vs90.vcproj
===================================================================
--- projects/openttd_vs90.vcproj (revision 22713)
+++ projects/openttd_vs90.vcproj (working copy)
@@ -1,7 +1,7 @@
+
+
+
+
@@ -2936,6 +2942,10 @@
>
+
+
Index: projects/openttd_vs100.vcxproj
===================================================================
--- projects/openttd_vs100.vcxproj (revision 22713)
+++ projects/openttd_vs100.vcxproj (working copy)
@@ -850,6 +850,7 @@
+
@@ -903,6 +904,7 @@
+
Index: projects/openttd_vs100.vcxproj.filters
===================================================================
--- projects/openttd_vs100.vcxproj.filters (revision 22713)
+++ projects/openttd_vs100.vcxproj.filters (working copy)
@@ -1770,6 +1770,9 @@
AI API
+
+ AI API
+
AI API
@@ -1929,6 +1932,9 @@
AI API Implementation
+
+ AI API Implementation
+
AI API Implementation
Index: bin/ai/compat_1.0.nut
===================================================================
--- bin/ai/compat_1.0.nut (revision 22713)
+++ bin/ai/compat_1.0.nut (working copy)
@@ -77,3 +77,16 @@
{
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
}
+
+// AirportType enum
+AIAirport.AT_SMALL <- 0; // The small airport.
+AIAirport.AT_LARGE <- 1; // The large airport.
+AIAirport.AT_METROPOLITAN <- 3; // The metropolitan airport.
+AIAirport.AT_INTERNATIONAL <- 4; // The international airport.
+AIAirport.AT_COMMUTER <- 5; // The commuter airport.
+AIAirport.AT_INTERCON <- 7; // The intercontinental airport.
+
+AIAirport.AT_HELIPORT <- 2; // The heliport.
+AIAirport.AT_HELISTATION <- 8; // The helistation.
+AIAirport.AT_HELIDEPOT <- 6; // The helidepot.
+AIAirport.AT_INVALID <- 255; // Invalid airport.
\ No newline at end of file
Index: bin/ai/compat_1.1.nut
===================================================================
--- bin/ai/compat_1.1.nut (revision 22713)
+++ bin/ai/compat_1.1.nut (working copy)
@@ -13,3 +13,16 @@
{
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
}
+
+// AirportType enum
+AIAirport.AT_SMALL <- 0; // The small airport.
+AIAirport.AT_LARGE <- 1; // The large airport.
+AIAirport.AT_METROPOLITAN <- 3; // The metropolitan airport.
+AIAirport.AT_INTERNATIONAL <- 4; // The international airport.
+AIAirport.AT_COMMUTER <- 5; // The commuter airport.
+AIAirport.AT_INTERCON <- 7; // The intercontinental airport.
+
+AIAirport.AT_HELIPORT <- 2; // The heliport.
+AIAirport.AT_HELISTATION <- 8; // The helistation.
+AIAirport.AT_HELIDEPOT <- 6; // The helidepot.
+AIAirport.AT_INVALID <- 255; // Invalid airport.
Index: bin/ai/compat_0.7.nut
===================================================================
--- bin/ai/compat_0.7.nut (revision 22713)
+++ bin/ai/compat_0.7.nut (working copy)
@@ -326,3 +326,16 @@
{
return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
}
+
+// AirportType enum
+AIAirport.AT_SMALL <- 0; // The small airport.
+AIAirport.AT_LARGE <- 1; // The large airport.
+AIAirport.AT_METROPOLITAN <- 3; // The metropolitan airport.
+AIAirport.AT_INTERNATIONAL <- 4; // The international airport.
+AIAirport.AT_COMMUTER <- 5; // The commuter airport.
+AIAirport.AT_INTERCON <- 7; // The intercontinental airport.
+
+AIAirport.AT_HELIPORT <- 2; // The heliport.
+AIAirport.AT_HELISTATION <- 8; // The helistation.
+AIAirport.AT_HELIDEPOT <- 6; // The helidepot.
+AIAirport.AT_INVALID <- 255; // Invalid airport.
\ No newline at end of file
Index: source.list
===================================================================
--- source.list (revision 22713)
+++ source.list (working copy)
@@ -623,6 +623,7 @@
# AI API
ai/api/ai_accounting.hpp
ai/api/ai_airport.hpp
+ai/api/ai_airporttypelist.hpp
ai/api/ai_base.hpp
ai/api/ai_basestation.hpp
ai/api/ai_bridge.hpp
@@ -678,6 +679,7 @@
# AI API Implementation
ai/api/ai_accounting.cpp
ai/api/ai_airport.cpp
+ai/api/ai_airporttypelist.cpp
ai/api/ai_base.cpp
ai/api/ai_basestation.cpp
ai/api/ai_bridge.cpp
ai_airport_type_list/src/ 0000755 0001750 0001001 00000000000 11623544752 014430 5 ustar Leif None ai_airport_type_list/src/ai/ 0000755 0001750 0001001 00000000000 11623544660 015017 5 ustar Leif None ai_airport_type_list/src/ai/api/ 0000755 0001750 0001001 00000000000 11623544661 015571 5 ustar Leif None ai_airport_type_list/src/ai/api/ai_airporttypelist.cpp 0000700 0001750 0001001 00000001703 11623544622 022213 0 ustar Leif None /* $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 .
*/
/** @file ai_airporttypelist.cpp Implementation of AIAirportTypeList. */
#include "../../stdafx.h"
#include "ai_airporttypelist.hpp"
#include "ai_airport.hpp"
#include "../../airport.h"
AIAirportTypeList::AIAirportTypeList()
{
for (byte j = 0; j <= NUM_AIRPORTS; j++) {
if (AIAirport::IsAirportInformationAvailable(j)) this->AddItem(j);
}
}
ai_airport_type_list/src/ai/api/ai_airporttypelist.hpp 0000700 0001750 0001001 00000002123 11623544622 022215 0 ustar Leif None /* $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 .
*/
/** @file ai_airporttypelist.hpp List all airport types. */
#ifndef AI_AIRPORTTYPELIST_HPP
#define AI_AIRPORTTYPELIST_HPP
#include "ai_list.hpp"
/**
* Creates a list of industries that are currently on the map.
* @ingroup AIList
*/
class AIAirportTypeList : public AIList {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIAirportTypeList"; }
AIAirportTypeList();
};
#endif /* AI_AIRPORTTYPELIST_HPP */
ai_airport_type_list/src/ai/api/ai_airporttypelist.hpp.sq 0000644 0001750 0001001 00000004521 11623544622 022652 0 ustar Leif None /* $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 .
*/
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
#include "ai_airporttypelist.hpp"
namespace SQConvert {
/* Allow AIAirportTypeList to be used as Squirrel parameter */
template <> AIAirportTypeList *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIAirportTypeList *)instance; }
template <> AIAirportTypeList &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAirportTypeList *)instance; }
template <> const AIAirportTypeList *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIAirportTypeList *)instance; }
template <> const AIAirportTypeList &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAirportTypeList *)instance; }
template <> int Return(HSQUIRRELVM vm, AIAirportTypeList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIAirportTypeList", res, NULL, DefSQDestructorCallback); return 1; }
} // namespace SQConvert
void SQAIAirportTypeList_Register(Squirrel *engine)
{
DefSQClass SQAIAirportTypeList("AIAirportTypeList");
SQAIAirportTypeList.PreRegister(engine, "AIList");
SQAIAirportTypeList.AddConstructor(engine, "x");
SQAIAirportTypeList.PostRegister(engine);
}