signs_base.h

Go to the documentation of this file.
00001 /* $Id: signs_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 SIGNS_BASE_H
00013 #define SIGNS_BASE_H
00014 
00015 #include "signs_type.h"
00016 #include "viewport_type.h"
00017 #include "core/pool_type.hpp"
00018 #include "company_type.h"
00019 
00020 typedef Pool<Sign, SignID, 16, 64000> SignPool;
00021 extern SignPool _sign_pool;
00022 
00023 struct Sign : SignPool::PoolItem<&_sign_pool> {
00024   char *name;
00025   ViewportSign sign;
00026   int32        x;
00027   int32        y;
00028   byte         z;
00029   OwnerByte    owner; // placed by this company. Anyone can delete them though. OWNER_NONE for gray signs from old games.
00030 
00034   Sign(Owner owner = INVALID_OWNER);
00035 
00037   ~Sign();
00038 
00039   void UpdateVirtCoord();
00040 };
00041 
00042 #define FOR_ALL_SIGNS_FROM(var, start) FOR_ALL_ITEMS_FROM(Sign, sign_index, var, start)
00043 #define FOR_ALL_SIGNS(var) FOR_ALL_SIGNS_FROM(var, 0)
00044 
00045 #endif /* SIGNS_BASE_H */

Generated on Wed Mar 31 22:43:28 2010 for OpenTTD by  doxygen 1.6.1