Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* $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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */ | ||
|
||
#include "../script_roadtypelist.hpp" | ||
#include "../template/template_roadtypelist.hpp.sq" | ||
|
||
|
||
template <> const char *GetClassName<ScriptRoadTypeList, ST_AI>() { return "AIRoadTypeList"; } | ||
|
||
void SQAIRoadTypeList_Register(Squirrel *engine) | ||
{ | ||
DefSQClass<ScriptRoadTypeList, ST_AI> SQAIRoadTypeList("AIRoadTypeList"); | ||
SQAIRoadTypeList.PreRegister(engine, "AIList"); | ||
SQAIRoadTypeList.AddConstructor<void (ScriptRoadTypeList::*)(), 1>(engine, "x"); | ||
|
||
SQAIRoadTypeList.PostRegister(engine); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* $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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */ | ||
|
||
#include "../script_roadtypelist.hpp" | ||
#include "../template/template_roadtypelist.hpp.sq" | ||
|
||
|
||
template <> const char *GetClassName<ScriptRoadTypeList, ST_GS>() { return "GSRoadTypeList"; } | ||
|
||
void SQGSRoadTypeList_Register(Squirrel *engine) | ||
{ | ||
DefSQClass<ScriptRoadTypeList, ST_GS> SQGSRoadTypeList("GSRoadTypeList"); | ||
SQGSRoadTypeList.PreRegister(engine, "GSList"); | ||
SQGSRoadTypeList.AddConstructor<void (ScriptRoadTypeList::*)(), 1>(engine, "x"); | ||
|
||
SQGSRoadTypeList.PostRegister(engine); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* $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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** @file script_roadtypelist.cpp Implementation of ScriptRoadTypeList and friends. */ | ||
|
||
#include "../../stdafx.h" | ||
#include "script_roadtypelist.hpp" | ||
#include "../../road_func.h" | ||
|
||
#include "../../safeguards.h" | ||
|
||
ScriptRoadTypeList::ScriptRoadTypeList() | ||
{ | ||
for (RoadType rt = ROADTYPE_BEGIN; rt != ROADTYPE_END; rt++) { | ||
if (ScriptObject::GetCompany() == OWNER_DEITY || ::HasRoadTypeAvail(ScriptObject::GetCompany(), rt)) this->AddItem(rt); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* $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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** @file script_roadtypelist.hpp List all available roadtypes. */ | ||
|
||
#ifndef SCRIPT_ROADTYPELIST_HPP | ||
#define SCRIPT_ROADTYPELIST_HPP | ||
|
||
#include "script_list.hpp" | ||
#include "script_road.hpp" | ||
|
||
/** | ||
* Creates a list of all available roadtypes. | ||
* @api ai game | ||
* @ingroup ScriptList | ||
*/ | ||
class ScriptRoadTypeList : public ScriptList { | ||
public: | ||
ScriptRoadTypeList(); | ||
}; | ||
|
||
#endif /* SCRIPT_ROADTYPELIST_HPP */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* $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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */ | ||
|
||
#include "../script_roadtypelist.hpp" | ||
|
||
namespace SQConvert { | ||
/* Allow ScriptRoadTypeList to be used as Squirrel parameter */ | ||
template <> inline ScriptRoadTypeList *GetParam(ForceType<ScriptRoadTypeList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptRoadTypeList *)instance; } | ||
template <> inline ScriptRoadTypeList &GetParam(ForceType<ScriptRoadTypeList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptRoadTypeList *)instance; } | ||
template <> inline const ScriptRoadTypeList *GetParam(ForceType<const ScriptRoadTypeList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptRoadTypeList *)instance; } | ||
template <> inline const ScriptRoadTypeList &GetParam(ForceType<const ScriptRoadTypeList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptRoadTypeList *)instance; } | ||
template <> inline int Return<ScriptRoadTypeList *>(HSQUIRRELVM vm, ScriptRoadTypeList *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "RoadTypeList", res, nullptr, DefSQDestructorCallback<ScriptRoadTypeList>, true); return 1; } | ||
} // namespace SQConvert |