00001 /* $Id$ */ 00002 00003 /* 00004 * This file is part of OpenTTD. 00005 * 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. 00006 * 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. 00007 * 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/>. 00008 */ 00009 00012 #ifndef SCRIPT_SUBSIDY_HPP 00013 #define SCRIPT_SUBSIDY_HPP 00014 00015 #include "script_company.hpp" 00016 00021 class ScriptSubsidy : public ScriptObject { 00022 public: 00027 enum SubsidyParticipantType { 00028 SPT_INDUSTRY = 0, 00029 SPT_TOWN = 1, 00030 SPT_INVALID = 0xFF, 00031 }; 00032 00038 static bool IsValidSubsidy(SubsidyID subsidy_id); 00039 00046 static bool IsAwarded(SubsidyID subsidy_id); 00047 00054 static ScriptCompany::CompanyID GetAwardedTo(SubsidyID subsidy_id); 00055 00066 static int32 GetExpireDate(SubsidyID subsidy_id); 00067 00075 static CargoID GetCargoType(SubsidyID subsidy_id); 00076 00083 static SubsidyParticipantType GetSourceType(SubsidyID subsidy_id); 00084 00093 static int32 GetSourceIndex(SubsidyID subsidy_id); 00094 00101 static SubsidyParticipantType GetDestinationType(SubsidyID subsidy_id); 00102 00111 static int32 GetDestinationIndex(SubsidyID subsidy_id); 00112 }; 00113 00114 #endif /* SCRIPT_SUBSIDY_HPP */