rubidium@9405: /* $Id$ */ rubidium@9405: truebrain@9829: /** @file ai_cargo.hpp Everything to query 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: truelight@9529: static const char *GetClassName() { return "AICargo"; } truelight@9529: truelight@9529: /** rubidium@9472: * Checks whether the given cargo type is valid. truebrain@9835: * @param cargo_type The cargo to check. truebrain@9835: * @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. truebrain@9835: * @param cargo_type The cargo to get the string representation of. truebrain@9835: * @return The cargo label. truebrain@9835: * @note Never use this to check if it is a certain cargo. NewGRF can truebrain@9835: * redefine all of the names. 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. truebrain@9835: * @param cargo_type The cargo to check on. truebrain@9835: * @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@9835: * @param cargo_type The cargo to transport. truebrain@9835: * @param distance The distance the cargo travels from begin to end. truebrain@9835: * @param days_in_transit Amount of (game) days the cargo is in transit. truebrain@9835: * @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 */