00001 /* $Id: ai_subsidy.hpp 20288 2010-08-01 20:41:46Z yexo $ */ 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 AI_SUBSIDY_HPP 00013 #define AI_SUBSIDY_HPP 00014 00015 #include "ai_object.hpp" 00016 #include "ai_company.hpp" 00017 00021 class AISubsidy : public AIObject { 00022 public: 00024 static const char *GetClassName() { return "AISubsidy"; } 00025 00030 enum SubsidyParticipantType { 00031 SPT_INDUSTRY = 0, 00032 SPT_TOWN = 1, 00033 SPT_INVALID = 0xFF, 00034 }; 00035 00041 static bool IsValidSubsidy(SubsidyID subsidy_id); 00042 00049 static bool IsAwarded(SubsidyID subsidy_id); 00050 00057 static AICompany::CompanyID GetAwardedTo(SubsidyID subsidy_id); 00058 00069 static int32 GetExpireDate(SubsidyID subsidy_id); 00070 00078 static CargoID GetCargoType(SubsidyID subsidy_id); 00079 00086 static SubsidyParticipantType GetSourceType(SubsidyID subsidy_id); 00087 00096 static int32 GetSourceIndex(SubsidyID subsidy_id); 00097 00104 static SubsidyParticipantType GetDestinationType(SubsidyID subsidy_id); 00105 00114 static int32 GetDestinationIndex(SubsidyID subsidy_id); 00115 }; 00116 00117 #endif /* AI_SUBSIDY_HPP */