# autoreplace_base.h

Go to the documentation of this file.

    00001 /* $Id: autoreplace_base.h 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 AUTOREPLACE_BASE_H
    00013 #define AUTOREPLACE_BASE_H
    00014
    00015 #include "core/pool_type.hpp"
    00016 #include "autoreplace_type.h"
    00017 #include "engine_type.h"
    00018 #include "group_type.h"
    00019
    00020 typedef uint16 EngineRenewID;
    00021
    00027 typedef Pool<EngineRenew, EngineRenewID, 16, 64000> EngineRenewPool;
    00028 extern EngineRenewPool _enginerenew_pool;
    00029
    00035 struct EngineRenew : EngineRenewPool::PoolItem<&_enginerenew_pool> {
    00036   EngineID from;
    00037   EngineID to;
    00038   EngineRenew *next;
    00039   GroupID group_id;
    00040
    00041   EngineRenew(EngineID from = INVALID_ENGINE, EngineID to = INVALID_ENGINE) : from(from), to(to) {}
    00042   ~EngineRenew() {}
    00043 };
    00044
    00045 #define FOR_ALL_ENGINE_RENEWS_FROM(var, start) FOR_ALL_ITEMS_FROM(EngineRenew, enginerenew_index, var, start)
    00046 #define FOR_ALL_ENGINE_RENEWS(var) FOR_ALL_ENGINE_RENEWS_FROM(var, 0)
    00047
    00048 #endif /* AUTOREPLACE_BASE_H */