@@ -81,24 +81,26 @@ struct Industry : IndustryPool::PoolItem
byte was_cargo_delivered; ///< flag that indicate this has been the closest industry chosen for cargo delivery by a station. see DeliverGoodsToIndustry
IndustryControlFlags ctlflags; ///< flags overriding standard behaviours
PartOfSubsidy part_of_subsidy; ///< NOSAVE: is this industry a source/destination of a subsidy?
StationList stations_near; ///< NOSAVE: List of nearby stations.
mutable std::string cached_name; ///< NOSAVE: Cache of the resolved name of the industry
Owner founder; ///< Founder of the industry
Date construction_date; ///< Date of the construction of the industry
uint8 construction_type; ///< Way the industry was constructed (@see IndustryConstructionType)
Date last_cargo_accepted_at[INDUSTRY_NUM_INPUTS]; ///< Last day each cargo type was accepted by this industry
byte selected_layout; ///< Which tile layout was used when creating the industry
Owner exclusive_supplier; ///< Which company has exclusive rights to deliver cargo (INVALID_OWNER = anyone)
Owner exclusive_consumer; ///< Which company has exclusive rights to take cargo (INVALID_OWNER = anyone)
uint16 random; ///< Random value used for randomisation of all kinds of things
PersistentStorage *psa; ///< Persistent storage for NewGRF industries.
* savegame will simply fail to load because they all contain chunks we
* cannot digest. But, this gives for ugly errors. As we have plenty of
* versions anyway, we simply skip the versions we know belong to
* patchpacks. This way we can present the user with a clean error
* indicate he is loading a savegame from a patchpack.
* For future patchpack creators: please follow a system like JGRPP, where
* the version is masked with 0x8000, and the true version is stored in
* its own chunk with feature toggles.
*/
SLV_START_PATCHPACKS, ///< 220 First known patchpack to use a version just above ours.
SLV_END_PATCHPACKS = 286, ///< 286 Last known patchpack to use a version just above ours.
SLV_GS_INDUSTRY_CONTROL, ///< 287 PR#7912 GS industry control.
SLV_GS_INDUSTRY_CONTROL, ///< 287 PR#7912 and PR#8115 GS industry control.
SL_MAX_VERSION, ///< Highest possible saveload version
};
/** Save or load result codes. */
enum SaveOrLoadResult {
SL_OK = 0, ///< completed successfully
SL_ERROR = 1, ///< error that was caught before internal structures were modified
SL_REINIT = 2, ///< error that was caught in the middle of updating game state, need to clear it. (can only happen during load)
};
/** Deals with the type of the savegame, independent of extension */
src/script/api/game_changelog.hpp
➞
Show inline comments
@@ -14,26 +14,30 @@
* in GetAPIVersion() in info.nut.
*
* \b 1.11.0
*
* This version is not yet released. The following changes are not set in stone yet.
*
* API additions:
* \li GSEventStoryPageButtonClick
* \li GSEventStoryPageTileSelect
* \li GSEventStoryPageVehicleSelect
* \li GSIndustry::GetCargoLastAcceptedDate
* \li GSIndustry::GetControlFlags
* \li GSIndustry::GetExclusiveConsumer
* \li GSIndustry::GetExclusiveSupplier
* \li GSIndustry::GetLastProductionYear
* \li GSIndustry::SetControlFlags
* \li GSIndustry::SetExclusiveConsumer
* \li GSIndustry::SetExclusiveSupplier
* \li GSStoryPage::MakePushButtonReference
* \li GSStoryPage::MakeTileButtonReference
* \li GSStoryPage::MakeVehicleButtonReference
* \li GSPriorityQueue
*
* \b 1.10.0
*
* API additions:
* \li GSVehicle::BuildVehicleWithRefit
* \li GSVehicle::GetBuildWithRefitCapacity
* \li GSRoad::GetName
* \li GSRoad::RoadVehCanRunOnRoad
src/script/api/script_industry.cpp
➞
Show inline comments
/*
* 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_industry.cpp Implementation of ScriptIndustry. */
* 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_industry.hpp Everything to query and build industries. */
#ifndef SCRIPT_INDUSTRY_HPP
#define SCRIPT_INDUSTRY_HPP
#include "script_company.hpp"
#include "script_date.hpp"
#include "script_object.hpp"
#include "script_date.hpp"
#include "../../industry.h"
/**
* Class that handles all industry related functions.
* @api ai game
*/
class ScriptIndustry : public ScriptObject {
public:
/** Ways for an industry to accept a cargo. */
enum CargoAcceptState {
CAS_NOT_ACCEPTED, ///< The CargoID is not accepted by this industry.
CAS_ACCEPTED, ///< The industry currently accepts this CargoID.