# ai_storage.hpp

Go to the documentation of this file.

    00001 /* $Id: ai_storage.hpp 17248 2009-08-21 20:21:05Z 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 "../group.h"
    00023
    00024 #include <vector>
    00025
    00029 typedef bool (AIModeProc)(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs);
    00030
    00034 class AIStorage {
    00035 friend class AIObject;
    00036 private:
    00037   AIModeProc *mode;
    00038   class AIObject *mode_instance;
    00039
    00040   uint delay;
    00041   bool allow_do_command;
    00042
    00043   CommandCost costs;
    00044   Money last_cost;
    00045   uint last_error;
    00046   bool last_command_res;
    00047
    00048   VehicleID new_vehicle_id;
    00049   SignID new_sign_id;
    00050   TileIndex new_tunnel_endtile;
    00051   GroupID new_group_id;
    00052
    00053   std::vector<int> callback_value;
    00054
    00055   RoadType road_type;
    00056   RailType rail_type;
    00057
    00058   void *event_data;
    00059   void *log_data;
    00060
    00061 public:
    00062   AIStorage() :
    00063     mode              (NULL),
    00064     mode_instance     (NULL),
    00065     delay             (1),
    00066     allow_do_command  (true),
    00067     /* costs (can't be set) */
    00068     last_cost         (0),
    00069     last_error        (STR_NULL),
    00070     last_command_res  (true),
    00071     new_vehicle_id    (0),
    00072     new_sign_id       (0),
    00073     new_tunnel_endtile(INVALID_TILE),
    00074     new_group_id      (0),
    00075     /* calback_value (can't be set) */
    00076     road_type         (INVALID_ROADTYPE),
    00077     rail_type         (INVALID_RAILTYPE),
    00078     event_data        (NULL),
    00079     log_data          (NULL)
    00080   { }
    00081
    00082   ~AIStorage();
    00083 };
    00084
    00085 #endif /* AI_STORAGE_HPP */