# ai_group.hpp

Go to the documentation of this file.

    00001 /* $Id: ai_group.hpp 18930 2010-01-27 20:51:11Z frosch $ */
    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_object.hpp"
    00016 #include "ai_vehicle.hpp"
    00017
    00021 class AIGroup : public AIObject {
    00022 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
    00155   static bool SetAutoReplace(GroupID group_id, EngineID engine_id_old, EngineID engine_id_new);
    00156
    00165   static EngineID GetEngineReplacement(GroupID group_id, EngineID engine_id);
    00166
    00174   static bool StopAutoReplace(GroupID group_id, EngineID engine_id);
    00175 };
    00176
    00177 #endif /* AI_GROUP_HPP */