/* $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 "../../script/api/script_tile.hpp"
namespace SQConvert {
/* Allow enums to be used as Squirrel parameters */
template <> inline ScriptTile::ErrorMessages GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptTile::ErrorMessages)tmp; }
template <> inline int Return(HSQUIRRELVM vm, ScriptTile::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptTile::Corner GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptTile::Corner)tmp; }
template <> inline int Return(HSQUIRRELVM vm, ScriptTile::Corner res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptTile::Slope GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptTile::Slope)tmp; }
template <> inline int Return(HSQUIRRELVM vm, ScriptTile::Slope res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptTile::TransportType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptTile::TransportType)tmp; }
template <> inline int Return(HSQUIRRELVM vm, ScriptTile::TransportType res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptTile::BuildType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptTile::BuildType)tmp; }
template <> inline int Return(HSQUIRRELVM vm, ScriptTile::BuildType res) { sq_pushinteger(vm, (int32)res); return 1; }
/* Allow ScriptTile to be used as Squirrel parameter */
template <> inline ScriptTile *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptTile *)instance; }
template <> inline ScriptTile &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTile *)instance; }
template <> inline const ScriptTile *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptTile *)instance; }
template <> inline const ScriptTile &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTile *)instance; }
template <> inline int Return(HSQUIRRELVM vm, ScriptTile *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Tile", res, NULL, DefSQDestructorCallback, true); return 1; }
} // namespace SQConvert
template <> const char *GetClassName() { return "AITile"; }
void SQAITile_Register(Squirrel *engine)
{
DefSQClass SQAITile("AITile");
SQAITile.PreRegister(engine);
SQAITile.AddConstructor(engine, "x");
SQAITile.DefSQConst(engine, ScriptTile::ERR_TILE_BASE, "ERR_TILE_BASE");
SQAITile.DefSQConst(engine, ScriptTile::ERR_TILE_TOO_HIGH, "ERR_TILE_TOO_HIGH");
SQAITile.DefSQConst(engine, ScriptTile::ERR_TILE_TOO_LOW, "ERR_TILE_TOO_LOW");
SQAITile.DefSQConst(engine, ScriptTile::ERR_AREA_ALREADY_FLAT, "ERR_AREA_ALREADY_FLAT");
SQAITile.DefSQConst(engine, ScriptTile::ERR_EXCAVATION_WOULD_DAMAGE, "ERR_EXCAVATION_WOULD_DAMAGE");
SQAITile.DefSQConst(engine, ScriptTile::CORNER_W, "CORNER_W");
SQAITile.DefSQConst(engine, ScriptTile::CORNER_S, "CORNER_S");
SQAITile.DefSQConst(engine, ScriptTile::CORNER_E, "CORNER_E");
SQAITile.DefSQConst(engine, ScriptTile::CORNER_N, "CORNER_N");
SQAITile.DefSQConst(engine, ScriptTile::CORNER_INVALID, "CORNER_INVALID");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_FLAT, "SLOPE_FLAT");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_W, "SLOPE_W");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_S, "SLOPE_S");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_E, "SLOPE_E");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_N, "SLOPE_N");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_STEEP, "SLOPE_STEEP");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_NW, "SLOPE_NW");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_SW, "SLOPE_SW");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_SE, "SLOPE_SE");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_NE, "SLOPE_NE");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_EW, "SLOPE_EW");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_NS, "SLOPE_NS");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_ELEVATED, "SLOPE_ELEVATED");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_NWS, "SLOPE_NWS");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_WSE, "SLOPE_WSE");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_SEN, "SLOPE_SEN");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_ENW, "SLOPE_ENW");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_STEEP_W, "SLOPE_STEEP_W");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_STEEP_S, "SLOPE_STEEP_S");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_STEEP_E, "SLOPE_STEEP_E");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_STEEP_N, "SLOPE_STEEP_N");
SQAITile.DefSQConst(engine, ScriptTile::SLOPE_INVALID, "SLOPE_INVALID");
SQAITile.DefSQConst(engine, ScriptTile::TRANSPORT_RAIL, "TRANSPORT_RAIL");
SQAITile.DefSQConst(engine, ScriptTile::TRANSPORT_ROAD, "TRANSPORT_ROAD");
SQAITile.DefSQConst(engine, ScriptTile::TRANSPORT_WATER, "TRANSPORT_WATER");
SQAITile.DefSQConst(engine, ScriptTile::TRANSPORT_AIR, "TRANSPORT_AIR");
SQAITile.DefSQConst(engine, ScriptTile::TRANSPORT_INVALID, "TRANSPORT_INVALID");
SQAITile.DefSQConst(engine, ScriptTile::BT_FOUNDATION, "BT_FOUNDATION");
SQAITile.DefSQConst(engine, ScriptTile::BT_TERRAFORM, "BT_TERRAFORM");
SQAITile.DefSQConst(engine, ScriptTile::BT_BUILD_TREES, "BT_BUILD_TREES");
SQAITile.DefSQConst(engine, ScriptTile::BT_CLEAR_GRASS, "BT_CLEAR_GRASS");
SQAITile.DefSQConst(engine, ScriptTile::BT_CLEAR_ROUGH, "BT_CLEAR_ROUGH");
SQAITile.DefSQConst(engine, ScriptTile::BT_CLEAR_ROCKY, "BT_CLEAR_ROCKY");
SQAITile.DefSQConst(engine, ScriptTile::BT_CLEAR_FIELDS, "BT_CLEAR_FIELDS");
SQAITile.DefSQConst(engine, ScriptTile::BT_CLEAR_HOUSE, "BT_CLEAR_HOUSE");
ScriptError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, ScriptTile::ERR_TILE_TOO_HIGH);
ScriptError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, ScriptTile::ERR_TILE_TOO_LOW);
ScriptError::RegisterErrorMap(STR_ERROR_ALREADY_LEVELLED, ScriptTile::ERR_AREA_ALREADY_FLAT);
ScriptError::RegisterErrorMap(STR_ERROR_EXCAVATION_WOULD_DAMAGE, ScriptTile::ERR_EXCAVATION_WOULD_DAMAGE);
ScriptError::RegisterErrorMapString(ScriptTile::ERR_TILE_TOO_HIGH, "ERR_TILE_TOO_HIGH");
ScriptError::RegisterErrorMapString(ScriptTile::ERR_TILE_TOO_LOW, "ERR_TILE_TOO_LOW");
ScriptError::RegisterErrorMapString(ScriptTile::ERR_AREA_ALREADY_FLAT, "ERR_AREA_ALREADY_FLAT");
ScriptError::RegisterErrorMapString(ScriptTile::ERR_EXCAVATION_WOULD_DAMAGE, "ERR_EXCAVATION_WOULD_DAMAGE");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsBuildable, "IsBuildable", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsBuildableRectangle, "IsBuildableRectangle", 4, ".iii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsWaterTile, "IsWaterTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsCoastTile, "IsCoastTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsStationTile, "IsStationTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsSteepSlope, "IsSteepSlope", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsHalftileSlope, "IsHalftileSlope", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::HasTreeOnTile, "HasTreeOnTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsFarmTile, "IsFarmTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsRockTile, "IsRockTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsRoughTile, "IsRoughTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsSnowTile, "IsSnowTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsDesertTile, "IsDesertTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetSlope, "GetSlope", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetComplementSlope, "GetComplementSlope", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetMinHeight, "GetMinHeight", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetMaxHeight, "GetMaxHeight", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetCornerHeight, "GetCornerHeight", 3, ".ii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetOwner, "GetOwner", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::HasTransportType, "HasTransportType", 3, ".ii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetCargoAcceptance, "GetCargoAcceptance", 6, ".iiiii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetCargoProduction, "GetCargoProduction", 6, ".iiiii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetDistanceManhattanToTile, "GetDistanceManhattanToTile", 3, ".ii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetDistanceSquareToTile, "GetDistanceSquareToTile", 3, ".ii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::RaiseTile, "RaiseTile", 3, ".ii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::LowerTile, "LowerTile", 3, ".ii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::LevelTiles, "LevelTiles", 3, ".ii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::DemolishTile, "DemolishTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::PlantTree, "PlantTree", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::PlantTreeRectangle, "PlantTreeRectangle", 4, ".iii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsWithinTownInfluence, "IsWithinTownInfluence", 3, ".ii");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetTownAuthority, "GetTownAuthority", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetClosestTown, "GetClosestTown", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetBuildCost, "GetBuildCost", 2, ".i");
SQAITile.PostRegister(engine);
}