# ai_storage.hpp

Go to the documentation of this file.

    00001 /* $Id: ai_storage.hpp 18809 2010-01-15 16:41:15Z rubidium $ */
    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_STORAGE_HPP
    00013 #define AI_STORAGE_HPP
    00014
    00015 #include "../command_func.h"
    00016 #include "../map_func.h"
    00017 #include "../network/network.h"
    00018 #include "../company_func.h"
    00019 #include "../signs_func.h"
    00020 #include "../tunnelbridge.h"
    00021 #include "../vehicle_func.h"
    00022 #include "../road_type.h"
    00023 #include "../group.h"
    00024
    00025 #include "table/strings.h"
    00026 #include <vector>
    00027
    00031 typedef bool (AIModeProc)();
    00032
    00036 class AIStorage {
    00037 friend class AIObject;
    00038 private:
    00039   AIModeProc *mode;
    00040   class AIObject *mode_instance;
    00041
    00042   uint delay;
    00043   bool allow_do_command;
    00044
    00045   CommandCost costs;
    00046   Money last_cost;
    00047   uint last_error;
    00048   bool last_command_res;
    00049
    00050   VehicleID new_vehicle_id;
    00051   SignID new_sign_id;
    00052   TileIndex new_tunnel_endtile;
    00053   GroupID new_group_id;
    00054
    00055   std::vector<int> callback_value;
    00056
    00057   RoadType road_type;
    00058   RailType rail_type;
    00059
    00060   void *event_data;
    00061   void *log_data;
    00062
    00063 public:
    00064   AIStorage() :
    00065     mode              (NULL),
    00066     mode_instance     (NULL),
    00067     delay             (1),
    00068     allow_do_command  (true),
    00069     /* costs (can't be set) */
    00070     last_cost         (0),
    00071     last_error        (STR_NULL),
    00072     last_command_res  (true),
    00073     new_vehicle_id    (0),
    00074     new_sign_id       (0),
    00075     new_tunnel_endtile(INVALID_TILE),
    00076     new_group_id      (0),
    00077     /* calback_value (can't be set) */
    00078     road_type         (INVALID_ROADTYPE),
    00079     rail_type         (INVALID_RAILTYPE),
    00080     event_data        (NULL),
    00081     log_data          (NULL)
    00082   { }
    00083
    00084   ~AIStorage();
    00085 };
    00086
    00087 #endif /* AI_STORAGE_HPP */