rubidium@9405: /* $Id$ */ rubidium@9405: rubidium@9405: /** @file ai_cargo.hpp Everything to query about cargos */ rubidium@9405: rubidium@9405: #ifndef AI_CARGO_HPP rubidium@9405: #define AI_CARGO_HPP rubidium@9405: rubidium@9405: #include "ai_object.hpp" rubidium@9405: truelight@9447: /** truelight@9447: * Class that handles all cargo related functions. truelight@9447: */ rubidium@9405: class AICargo : public AIObject { rubidium@9405: public: rubidium@9405: /** truelight@9529: * The name of the class, needed by several sub-processes. truelight@9529: */ truelight@9529: static const char *GetClassName() { return "AICargo"; } truelight@9529: truelight@9529: /** rubidium@9472: * Checks whether the given cargo type is valid. rubidium@9472: * @param cargo_type the cargo to check. rubidium@9472: * @return true if and only if the cargo type is valid. rubidium@9472: */ truelight@9490: static bool IsValidCargo(CargoID cargo_type); rubidium@9472: rubidium@9472: /** truelight@9447: * Gets the string representation of the cargo label. truelight@9447: * @param cargo_type to get the string representation of. truelight@9447: * @return the cargo label. truelight@9447: * @note the returned cargo label must be free'd (C++ only). rubidium@9405: */ truebrain@9737: static char *GetCargoLabel(CargoID cargo_type); rubidium@9405: rubidium@9405: /** truelight@9447: * Checks whether the give cargo is a freight or not. rubidium@9405: * @param cargo_type is this cargo freight or not? truelight@9447: * @return true if and only if the cargo is freight. rubidium@9405: */ truebrain@9737: static bool IsFreight(CargoID cargo_type); rubidium@9405: rubidium@9405: /** rubidium@9405: * Get the income for transporting a piece of cargo over the truelight@9447: * given distance within the specified time. truebrain@9814: * @param cargo_type the cargo to transport. truelight@9447: * @param distance the distance the cargo travels from begin to end. truelight@9447: * @param days_in_transit amount of (game) days the cargo is in transit. truelight@9447: * @return the amount of money that would be earned by this trip. rubidium@9405: */ truebrain@9814: static int32 GetCargoIncome(CargoID cargo_type, uint32 distance, uint32 days_in_transit); rubidium@9405: }; rubidium@9405: rubidium@9405: #endif /* AI_CARGO_HPP */