OpenTTD
signs_base.h
Go to the documentation of this file.
1 /* $Id: signs_base.h 23104 2011-11-04 11:09:06Z rubidium $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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  */
9 
12 #ifndef SIGNS_BASE_H
13 #define SIGNS_BASE_H
14 
15 #include "signs_type.h"
16 #include "viewport_type.h"
17 #include "core/pool_type.hpp"
18 #include "company_type.h"
19 
21 extern SignPool _sign_pool;
22 
23 struct Sign : SignPool::PoolItem<&_sign_pool> {
24  char *name;
25  ViewportSign sign;
26  int32 x;
27  int32 y;
28  int32 z;
29  OwnerByte owner; // placed by this company. Anyone can delete them though. OWNER_NONE for gray signs from old games.
30 
31  Sign(Owner owner = INVALID_OWNER);
32  ~Sign();
33 
34  void UpdateVirtCoord();
35 };
36 
37 #define FOR_ALL_SIGNS_FROM(var, start) FOR_ALL_ITEMS_FROM(Sign, sign_index, var, start)
38 #define FOR_ALL_SIGNS(var) FOR_ALL_SIGNS_FROM(var, 0)
39 
40 #endif /* SIGNS_BASE_H */