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/>.
8 /** @file autoreplace_base.h Base class for autoreplaces/autorenews. */
10 #ifndef AUTOREPLACE_BASE_H
11 #define AUTOREPLACE_BASE_H
13 #include "core/pool_type.hpp"
14 #include "autoreplace_type.h"
15 #include "engine_type.h"
16 #include "group_type.h"
18 typedef uint16 EngineRenewID
;
21 * Memory pool for engine renew elements. DO NOT USE outside of engine.c. Is
22 * placed here so the only exception to this rule, the saveload code, can use
25 typedef Pool
<EngineRenew
, EngineRenewID
, 16, 64000> EngineRenewPool
;
26 extern EngineRenewPool _enginerenew_pool
;
29 * Struct to store engine replacements. DO NOT USE outside of engine.c. Is
30 * placed here so the only exception to this rule, the saveload code, can use
33 struct EngineRenew
: EngineRenewPool::PoolItem
<&_enginerenew_pool
> {
38 bool replace_when_old
; ///< Do replacement only when vehicle is old.
40 EngineRenew(EngineID from
= INVALID_ENGINE
, EngineID to
= INVALID_ENGINE
) : from(from
), to(to
) {}
44 #endif /* AUTOREPLACE_BASE_H */