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