# ai_group.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_GROUP_HPP
    00013 #define AI_GROUP_HPP
    00014
    00015 #include "ai_vehicle.hpp"
    00016
    00020 class AIGroup : public AIObject {
    00021 public:
    00023   static const char *GetClassName() { return "AIGroup"; }
    00024
    00028   enum GroupID {
    00029     /* Values are important, as they represent the internal state of the game (see group_type.h). */
    00030     GROUP_ALL = 0xFFFD,
    00031     GROUP_DEFAULT = 0xFFFE,
    00032     GROUP_INVALID = 0xFFFF,
    00033   };
    00034
    00041   static bool IsValidGroup(GroupID group_id);
    00042
    00050   static GroupID CreateGroup(AIVehicle::VehicleType vehicle_type);
    00051
    00059   static bool DeleteGroup(GroupID group_id);
    00060
    00067   static AIVehicle::VehicleType GetVehicleType(GroupID group_id);
    00068
    00079   static bool SetName(GroupID group_id, const char *name);
    00080
    00087   static char *GetName(GroupID group_id);
    00088
    00097   static bool EnableAutoReplaceProtection(GroupID group_id, bool enable);
    00098
    00105   static bool GetAutoReplaceProtection(GroupID group_id);
    00106
    00114   static int32 GetNumEngines(GroupID group_id, EngineID engine_id);
    00115
    00127   static bool MoveVehicle(GroupID group_id, VehicleID vehicle_id);
    00128
    00137   static bool EnableWagonRemoval(bool keep_length);
    00138
    00143   static bool HasWagonRemoval();
    00144
    00156   static bool SetAutoReplace(GroupID group_id, EngineID engine_id_old, EngineID engine_id_new);
    00157
    00166   static EngineID GetEngineReplacement(GroupID group_id, EngineID engine_id);
    00167
    00175   static bool StopAutoReplace(GroupID group_id, EngineID engine_id);
    00176 };
    00177
    00178 #endif /* AI_GROUP_HPP */