File diff r21218:8daf27729482 → r21219:7180bb39d4d9
src/script/api/script_subsidy.hpp
Show inline comments
 
@@ -4,24 +4,25 @@
 
 * 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_subsidy.hpp Everything to query subsidies. */
 

	
 
#ifndef SCRIPT_SUBSIDY_HPP
 
#define SCRIPT_SUBSIDY_HPP
 

	
 
#include "script_company.hpp"
 
#include "script_date.hpp"
 

	
 
/**
 
 * Class that handles all subsidy related functions.
 
 * @api ai game
 
 */
 
class ScriptSubsidy : public ScriptObject {
 
public:
 
	/**
 
	 * Enumeration for source and destination of a subsidy.
 
	 * @note The list of values may grow in future.
 
	 */
 
	enum SubsidyParticipantType {
 
@@ -74,25 +75,25 @@ public:
 
	static ScriptCompany::CompanyID GetAwardedTo(SubsidyID subsidy_id);
 

	
 
	/**
 
	 * Get the date this subsidy expires. In case the subsidy is already
 
	 *  awarded, return the date the subsidy expires, else, return the date the
 
	 *  offer expires.
 
	 * @param subsidy_id The SubsidyID to check.
 
	 * @pre IsValidSubsidy(subsidy_id).
 
	 * @return The last valid date of this subsidy.
 
	 * @note The return value of this function will change if the subsidy is
 
	 *  awarded.
 
	 */
 
	static int32 GetExpireDate(SubsidyID subsidy_id);
 
	static ScriptDate::Date GetExpireDate(SubsidyID subsidy_id);
 

	
 
	/**
 
	 * Get the cargo type that has to be transported in order to be awarded this
 
	 *  subsidy.
 
	 * @param subsidy_id The SubsidyID to check.
 
	 * @pre IsValidSubsidy(subsidy_id).
 
	 * @return The cargo type to transport.
 
	 */
 
	static CargoID GetCargoType(SubsidyID subsidy_id);
 

	
 
	/**
 
	 * Returns the type of source of subsidy.