autoreplace_base.h

Go to the documentation of this file.
00001 /* $Id$ */
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 
00018 typedef uint16 EngineRenewID;
00019 
00025 typedef Pool<EngineRenew, EngineRenewID, 16, 64000> EngineRenewPool;
00026 extern EngineRenewPool _enginerenew_pool;
00027 
00033 struct EngineRenew : EngineRenewPool::PoolItem<&_enginerenew_pool> {
00034   EngineID from;
00035   EngineID to;
00036   EngineRenew *next;
00037   GroupID group_id;
00038 
00039   EngineRenew(EngineID from = INVALID_ENGINE, EngineID to = INVALID_ENGINE) : from(from), to(to) {}
00040   ~EngineRenew() {}
00041 };
00042 
00043 #define FOR_ALL_ENGINE_RENEWS_FROM(var, start) FOR_ALL_ITEMS_FROM(EngineRenew, enginerenew_index, var, start)
00044 #define FOR_ALL_ENGINE_RENEWS(var) FOR_ALL_ENGINE_RENEWS_FROM(var, 0)
00045 
00046 #endif /* AUTOREPLACE_BASE_H */

Generated on Sat Dec 26 20:05:59 2009 for OpenTTD by  doxygen 1.5.6