ai_cargo.hpp

Go to the documentation of this file.
00001 /* $Id: ai_cargo.hpp 17248 2009-08-21 20:21:05Z rubidium $ */
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_CARGO_HPP
00013 #define AI_CARGO_HPP
00014 
00015 #include "ai_object.hpp"
00016 
00020 class AICargo : public AIObject {
00021 public:
00022   static const char *GetClassName() { return "AICargo"; }
00023 
00027   enum CargoClass {
00028     CC_PASSENGERS   = 1 <<  0, 
00029     CC_MAIL         = 1 <<  1, 
00030     CC_EXPRESS      = 1 <<  2, 
00031     CC_ARMOURED     = 1 <<  3, 
00032     CC_BULK         = 1 <<  4, 
00033     CC_PIECE_GOODS  = 1 <<  5, 
00034     CC_LIQUID       = 1 <<  6, 
00035     CC_REFRIGERATED = 1 <<  7, 
00036     CC_HAZARDOUS    = 1 <<  8, 
00037     CC_COVERED      = 1 <<  9, 
00038   };
00039 
00043   enum TownEffect {
00044     TE_NONE       = 0, 
00045     TE_PASSENGERS = 1, 
00046     TE_MAIL       = 2, 
00047     TE_GOODS      = 3, 
00048     TE_WATER      = 4, 
00049     TE_FOOD       = 5, 
00050   };
00051 
00057   static bool IsValidCargo(CargoID cargo_type);
00058 
00067   static char *GetCargoLabel(CargoID cargo_type);
00068 
00077   static bool IsFreight(CargoID cargo_type);
00078 
00086   static bool HasCargoClass(CargoID cargo_type, CargoClass cargo_class);
00087 
00094   static TownEffect GetTownEffect(CargoID cargo_type);
00095 
00105   static Money GetCargoIncome(CargoID cargo_type, uint32 distance, uint32 days_in_transit);
00106 };
00107 
00108 #endif /* AI_CARGO_HPP */

Generated on Tue Sep 14 17:06:46 2010 for OpenTTD by  doxygen 1.6.1