2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-03-31 07:25:49 +00:00
|
|
|
/** @file signs_base.h Base class for signs. */
|
2007-04-04 01:35:16 +00:00
|
|
|
|
2008-03-31 07:25:49 +00:00
|
|
|
#ifndef SIGNS_BASE_H
|
|
|
|
#define SIGNS_BASE_H
|
2005-01-12 11:21:28 +00:00
|
|
|
|
2008-03-31 07:25:49 +00:00
|
|
|
#include "signs_type.h"
|
2008-05-07 13:18:33 +00:00
|
|
|
#include "viewport_type.h"
|
2009-01-04 15:32:25 +00:00
|
|
|
#include "tile_type.h"
|
2009-05-22 15:39:22 +00:00
|
|
|
#include "core/pool_type.hpp"
|
2005-02-04 14:45:32 +00:00
|
|
|
|
2009-05-22 15:13:50 +00:00
|
|
|
typedef Pool<Sign, SignID, 16, 64000> SignPool;
|
|
|
|
extern SignPool _sign_pool;
|
2007-08-02 13:27:45 +00:00
|
|
|
|
2009-05-22 15:13:50 +00:00
|
|
|
struct Sign : SignPool::PoolItem<&_sign_pool> {
|
2008-01-12 19:58:06 +00:00
|
|
|
char *name;
|
2005-01-12 11:21:28 +00:00
|
|
|
ViewportSign sign;
|
|
|
|
int32 x;
|
|
|
|
int32 y;
|
|
|
|
byte z;
|
2008-09-30 20:39:50 +00:00
|
|
|
OwnerByte owner; // placed by this company. Anyone can delete them though. OWNER_NONE for gray signs from old games.
|
2005-01-12 11:21:28 +00:00
|
|
|
|
2007-08-02 13:27:45 +00:00
|
|
|
/**
|
|
|
|
* Creates a new sign
|
|
|
|
*/
|
2008-09-30 20:39:50 +00:00
|
|
|
Sign(Owner owner = INVALID_OWNER);
|
2007-08-02 13:27:45 +00:00
|
|
|
|
|
|
|
/** Destroy the sign */
|
|
|
|
~Sign();
|
2009-07-13 22:33:25 +00:00
|
|
|
|
|
|
|
void UpdateVirtCoord();
|
2007-03-07 12:11:48 +00:00
|
|
|
};
|
2005-01-12 11:21:28 +00:00
|
|
|
|
2009-05-22 14:23:36 +00:00
|
|
|
#define FOR_ALL_SIGNS_FROM(var, start) FOR_ALL_ITEMS_FROM(Sign, sign_index, var, start)
|
|
|
|
#define FOR_ALL_SIGNS(var) FOR_ALL_SIGNS_FROM(var, 0)
|
2005-01-12 11:21:28 +00:00
|
|
|
|
2008-03-31 07:25:49 +00:00
|
|
|
#endif /* SIGNS_BASE_H */
|