script_industry.hpp

Go to the documentation of this file.
00001 /* $Id: script_industry.hpp 23614 2011-12-19 20:57:23Z truebrain $ */
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_INDUSTRY_HPP
00013 #define SCRIPT_INDUSTRY_HPP
00014 
00015 #include "script_object.hpp"
00016 
00021 class ScriptIndustry : public ScriptObject {
00022 public:
00024   enum CargoAcceptState {
00025     CAS_NOT_ACCEPTED, 
00026     CAS_ACCEPTED,     
00027     CAS_TEMP_REFUSED, 
00028   };
00029 
00035   static int32 GetIndustryCount();
00036 
00042   static bool IsValidIndustry(IndustryID industry_id);
00043 
00052   static IndustryID GetIndustryID(TileIndex tile);
00053 
00060   static char *GetName(IndustryID industry_id);
00061 
00070   static CargoAcceptState IsCargoAccepted(IndustryID industry_id, CargoID cargo_id);
00071 
00080   static int32 GetStockpiledCargo(IndustryID industry_id, CargoID cargo_id);
00081 
00090   static int32 GetLastMonthProduction(IndustryID industry_id, CargoID cargo_id);
00091 
00100   static int32 GetLastMonthTransported(IndustryID industry_id, CargoID cargo_id);
00101 
00110   static int32 GetLastMonthTransportedPercentage(IndustryID industry_id, CargoID cargo_id);
00111 
00118   static TileIndex GetLocation(IndustryID industry_id);
00119 
00128   static int32 GetAmountOfStationsAround(IndustryID industry_id);
00129 
00139   static int32 GetDistanceManhattanToTile(IndustryID industry_id, TileIndex tile);
00140 
00150   static int32 GetDistanceSquareToTile(IndustryID industry_id, TileIndex tile);
00151 
00158   static bool IsBuiltOnWater(IndustryID industry_id);
00159 
00166   static bool HasHeliport(IndustryID industry_id);
00167 
00175   static TileIndex GetHeliportLocation(IndustryID industry_id);
00176 
00183   static bool HasDock(IndustryID industry_id);
00184 
00192   static TileIndex GetDockLocation(IndustryID industry_id);
00193 
00200   static IndustryType GetIndustryType(IndustryID industry_id);
00201 };
00202 
00203 #endif /* SCRIPT_INDUSTRY_HPP */