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"
|
2006-12-03 17:27:43 +00:00
|
|
|
#include "oldpool.h"
|
2005-02-04 14:45:32 +00:00
|
|
|
|
2007-08-02 14:27:45 +01:00
|
|
|
DECLARE_OLD_POOL(Sign, Sign, 2, 16000)
|
|
|
|
|
|
|
|
struct Sign : PoolItem<Sign, SignID, &_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();
|
|
|
|
|
2008-09-30 21:39:50 +01:00
|
|
|
inline bool IsValid() const { return this->owner != INVALID_OWNER; }
|
2007-03-07 12:11:48 +00:00
|
|
|
};
|
2005-01-12 11:21:28 +00:00
|
|
|
|
2009-05-17 00:44:36 +01:00
|
|
|
#define FOR_ALL_SIGNS_FROM(ss, start) for (ss = Sign::Get(start); ss != NULL; ss = (ss->index + 1U < Sign::GetPoolSize()) ? Sign::Get(ss->index + 1U) : NULL) if (ss->IsValid())
|
2005-02-04 14:45:32 +00:00
|
|
|
#define FOR_ALL_SIGNS(ss) FOR_ALL_SIGNS_FROM(ss, 0)
|
2005-01-12 11:21:28 +00:00
|
|
|
|
2008-03-31 08:25:49 +01:00
|
|
|
#endif /* SIGNS_BASE_H */
|