OpenTTD Source: src/autoreplace_base.h Source File

OpenTTD Source 1.11.0-RC1

autoreplace_base.h
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
7
10 #ifndef AUTOREPLACE_BASE_H
11 #define AUTOREPLACE_BASE_H
12
13 #include "core/pool_type.hpp"
14 #include "autoreplace_type.h"
15 #include "engine_type.h"
16 #include "group_type.h"
17
18 typedef uint16 EngineRenewID;
19
25 typedef Pool<EngineRenew, EngineRenewID, 16, 64000> EngineRenewPool;
26 extern EngineRenewPool _enginerenew_pool;
27
33 struct EngineRenew : EngineRenewPool::PoolItem<&_enginerenew_pool> {
34 EngineID from;
35 EngineID to;
36 EngineRenew *next;
37 GroupID group_id;
38 bool replace_when_old;
39
40 EngineRenew(EngineID from = INVALID_ENGINE, EngineID to = INVALID_ENGINE) : from(from), to(to) {}
41 ~EngineRenew() {}
42 };
43
44 #endif /* AUTOREPLACE_BASE_H */
INVALID_ENGINE
static const EngineID INVALID_ENGINE
Constant denoting an invalid engine.
Definition: engine_type.h:174
EngineRenew::replace_when_old
bool replace_when_old
Do replacement only when vehicle is old.
Definition: autoreplace_base.h:38
EngineID
uint16 EngineID
Unique identification number of an engine.
Definition: engine_type.h:21
EngineRenew
Struct to store engine replacements.
Definition: autoreplace_base.h:33
_enginerenew_pool
EngineRenewPool _enginerenew_pool
The pool of autoreplace "orders".
Pool
Base class for all pools.
Definition: pool_type.hpp:81
GroupID
uint16 GroupID
Type for all group identifiers.
Definition: group_type.h:13
engine_type.h
EngineRenewPool
Pool< EngineRenew, EngineRenewID, 16, 64000 > EngineRenewPool
Memory pool for engine renew elements.
Definition: autoreplace_base.h:25
autoreplace_type.h
pool_type.hpp
group_type.h
Pool::PoolItem
Base class for all PoolItems.
Definition: pool_type.hpp:226