if (type == OBJECT_HQ) UpdateCompanyHQ(tile, hq_score);
src/script/api/CMakeLists.txt
➞
Show inline comments
@@ -182,6 +182,8 @@ add_files(
script_newgrf.hpp
script_news.hpp
script_object.hpp
script_objecttype.hpp
script_objecttypelist.hpp
script_order.hpp
script_priorityqueue.hpp
script_rail.hpp
@@ -250,6 +252,8 @@ add_files(
script_newgrf.cpp
script_news.cpp
script_object.cpp
script_objecttype.cpp
script_objecttypelist.cpp
script_order.cpp
script_priorityqueue.cpp
script_rail.cpp
src/script/api/ai_changelog.hpp
➞
Show inline comments
@@ -26,6 +26,8 @@
* \li AITile::IsSeaTile
* \li AITile::IsRiverTile
* \li AITile::BT_CLEAR_WATER
* \li AIObjectTypeList
* \li AIObjectType
*
* \b 1.11.0
*
src/script/api/game_changelog.hpp
➞
Show inline comments
@@ -25,6 +25,8 @@
* \li GSTile::IsSeaTile
* \li GSTile::IsRiverTile
* \li GSTile::BT_CLEAR_WATER
* \li GSObjectTypeList
* \li GSObjectType
*
* \b 1.11.0
*
src/script/api/script_objecttype.cpp
➞
Show inline comments
new file 100644
/*
* 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_objecttype.cpp Implementation of ScriptObjectType. */
* 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_objecttype.hpp Everything to query and build industries. */
#ifndef SCRIPT_OBJECTTYPE_HPP
#define SCRIPT_OBJECTTYPE_HPP
#include "script_list.hpp"
#include "../../newgrf_object.h"
/**
* Class that handles all object-type related functions.
* @api ai game
*/
class ScriptObjectType : public ScriptObject {
public:
/**
* Checks whether the given object-type is valid.
* @param object_type The type to check.
* @return True if and only if the object-type is valid.
* 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_objecttypelist.cpp Implementation of ScriptObjectTypeList. */
#include "../../stdafx.h"
#include "script_objecttypelist.hpp"
#include "../../newgrf_object.h"
#include "../../safeguards.h"
ScriptObjectTypeList::ScriptObjectTypeList()
{
for (int i = 0; i < NUM_OBJECTS; i++) {
const ObjectSpec *spec = ObjectSpec::Get(i);
if (!spec->IsEverAvailable()) continue;
this->AddItem(i);
}
}
src/script/api/script_objecttypelist.hpp
➞
Show inline comments
new file 100644
/*
* 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_objecttypelist.hpp List all available object types. */