2005-07-24 15:12:37 +01:00
|
|
|
/* $Id$ */
|
|
|
|
|
2008-03-31 08:25:49 +01:00
|
|
|
/** @file signs_base.h Base class for signs. */
|
2007-04-04 02:35:16 +01:00
|
|
|
|
2008-03-31 08:25:49 +01:00
|
|
|
#ifndef SIGNS_BASE_H
|
|
|
|
#define SIGNS_BASE_H
|
2005-01-12 11:21:28 +00:00
|
|
|
|
2008-03-31 08:25:49 +01:00
|
|
|
#include "signs_type.h"
|
2008-05-07 14:18:33 +01:00
|
|
|
#include "viewport_type.h"
|
2009-01-04 15:32:25 +00:00
|
|
|
#include "tile_type.h"
|
2009-05-22 16:39:22 +01:00
|
|
|
#include "core/pool_type.hpp"
|
2005-02-04 14:45:32 +00:00
|
|
|
|
2009-05-22 16:13:50 +01:00
|
|
|
typedef Pool<Sign, SignID, 16, 64000> SignPool;
|
|
|
|
extern SignPool _sign_pool;
|
2007-08-02 14:27:45 +01:00
|
|
|
|
2009-05-22 16:13:50 +01: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 21:39:50 +01: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 14:27:45 +01:00
|
|
|
/**
|
|
|
|
* Creates a new sign
|
|
|
|
*/
|
2008-09-30 21:39:50 +01:00
|
|
|
Sign(Owner owner = INVALID_OWNER);
|
2007-08-02 14:27:45 +01:00
|
|
|
|
|
|
|
/** Destroy the sign */
|
|
|
|
~Sign();
|
2007-03-07 12:11:48 +00:00
|
|
|
};
|
2005-01-12 11:21:28 +00:00
|
|
|
|
2009-05-22 15:23:36 +01: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 08:25:49 +01:00
|
|
|
#endif /* SIGNS_BASE_H */
|