1
/* $Id: ai_storage.hpp 21890 2011-01-22 14:52:20Z rubidium $ */
4
* This file is part of OpenTTD.
5
* 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.
6
* 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.
7
* 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/>.
10
/** @file ai_storage.hpp Defines AIStorage and includes all files required for it. */
12
#ifndef AI_STORAGE_HPP
13
#define AI_STORAGE_HPP
15
#include "../signs_func.h"
16
#include "../vehicle_func.h"
17
#include "../road_type.h"
20
#include "table/strings.h"
24
* The callback function for Mode-classes.
26
typedef bool (AIModeProc)();
29
* The storage for each AI. It keeps track of important information.
32
friend class AIObject;
34
AIModeProc *mode; ///< The current build mode we are int.
35
class AIObject *mode_instance; ///< The instance belonging to the current build mode.
37
uint delay; ///< The ticks of delay each DoCommand has.
38
bool allow_do_command; ///< Is the usage of DoCommands restricted?
40
CommandCost costs; ///< The costs the AI is tracking.
41
Money last_cost; ///< The last cost of the command.
42
uint last_error; ///< The last error of the command.
43
bool last_command_res; ///< The last result of the command.
45
VehicleID new_vehicle_id; ///< The ID of the new Vehicle.
46
SignID new_sign_id; ///< The ID of the new Sign.
47
TileIndex new_tunnel_endtile; ///< The TileIndex of the new Tunnel.
48
GroupID new_group_id; ///< The ID of the new Group.
50
std::vector<int> callback_value; ///< The values which need to survive a callback.
52
RoadType road_type; ///< The current roadtype we build.
53
RailType rail_type; ///< The current railtype we build.
55
void *event_data; ///< Pointer to the event data storage.
56
void *log_data; ///< Pointer to the log data storage.
63
allow_do_command (true),
64
/* costs (can't be set) */
66
last_error (STR_NULL),
67
last_command_res (true),
70
new_tunnel_endtile(INVALID_TILE),
72
/* calback_value (can't be set) */
73
road_type (INVALID_ROADTYPE),
74
rail_type (INVALID_RAILTYPE),
82
#endif /* AI_STORAGE_HPP */