# ai_cargo.hpp

Go to the documentation of this file.

    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 AI_CARGO_HPP
    00013 #define AI_CARGO_HPP
    00014
    00015 #include "ai_object.hpp"
    00016
    00020 class AICargo : public AIObject {
    00021 public:
    00023   static const char *GetClassName() { return "AICargo"; }
    00024
    00028   enum CargoClass {
    00029     CC_PASSENGERS   = 1 <<  0,
    00030     CC_MAIL         = 1 <<  1,
    00031     CC_EXPRESS      = 1 <<  2,
    00032     CC_ARMOURED     = 1 <<  3,
    00033     CC_BULK         = 1 <<  4,
    00034     CC_PIECE_GOODS  = 1 <<  5,
    00035     CC_LIQUID       = 1 <<  6,
    00036     CC_REFRIGERATED = 1 <<  7,
    00037     CC_HAZARDOUS    = 1 <<  8,
    00038     CC_COVERED      = 1 <<  9,
    00039   };
    00040
    00044   enum TownEffect {
    00045     TE_NONE       = 0,
    00046     TE_PASSENGERS = 1,
    00047     TE_MAIL       = 2,
    00048     TE_GOODS      = 3,
    00049     TE_WATER      = 4,
    00050     TE_FOOD       = 5,
    00051   };
    00052
    00058   static bool IsValidCargo(CargoID cargo_type);
    00059
    00068   static char *GetCargoLabel(CargoID cargo_type);
    00069
    00078   static bool IsFreight(CargoID cargo_type);
    00079
    00087   static bool HasCargoClass(CargoID cargo_type, CargoClass cargo_class);
    00088
    00095   static TownEffect GetTownEffect(CargoID cargo_type);
    00096
    00106   static Money GetCargoIncome(CargoID cargo_type, uint32 distance, uint32 days_in_transit);
    00107 };
    00108
    00109 #endif /* AI_CARGO_HPP */