00001 /* $Id: signs_base.h 21846 2011-01-18 23:09:43Z 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 00031 Sign(Owner owner = INVALID_OWNER); 00032 ~Sign(); 00033 00034 void UpdateVirtCoord(); 00035 }; 00036 00037 #define FOR_ALL_SIGNS_FROM(var, start) FOR_ALL_ITEMS_FROM(Sign, sign_index, var, start) 00038 #define FOR_ALL_SIGNS(var) FOR_ALL_SIGNS_FROM(var, 0) 00039 00040 #endif /* SIGNS_BASE_H */