Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Encapsulates an in-game world map. More...
#include <Map.h>
Public Types | |
typedef std::vector< ColorID > | cColorList |
typedef std::vector< cClientHandle * > | cMapClientList |
typedef std::vector< cMapDecorator > | cMapDecoratorList |
typedef Byte | ColorID |
enum | eBaseColor { E_BASE_COLOR_TRANSPARENT = 0 , E_BASE_COLOR_LIGHT_GREEN = 4 , E_BASE_COLOR_LIGHT_BLUE = 5 , E_BASE_COLOR_LIGHT_BROWN = 8 , E_BASE_COLOR_GRAY_1 = 12 , E_BASE_COLOR_RED = 16 , E_BASE_COLOR_PALE_BLUE = 20 , E_BASE_COLOR_GRAY_2 = 24 , E_BASE_COLOR_DARK_GREEN = 28 , E_BASE_COLOR_WHITE = 32 , E_BASE_COLOR_LIGHT_GRAY = 36 , E_BASE_COLOR_BROWN = 40 , E_BASE_COLOR_DARK_GRAY = 44 , E_BASE_COLOR_BLUE = 48 , E_BASE_COLOR_DARK_BROWN = 52 } |
Public Member Functions | |
cMap (unsigned int a_ID, cWorld *a_World) | |
Construct an empty map. More... | |
cMap (unsigned int a_ID, int a_CenterX, int a_CenterZ, cWorld *a_World, unsigned int a_Scale=3) | |
Construct an empty map at the specified coordinates. More... | |
const cMapDecorator | CreateDecorator (const cEntity *a_TrackedEntity) |
int | GetCenterX (void) const |
int | GetCenterZ (void) const |
const cColorList & | GetData (void) const |
const cMapDecoratorList | GetDecorators (void) const |
eDimension | GetDimension (void) const |
unsigned int | GetHeight (void) const |
unsigned int | GetID (void) const |
AString | GetName (void) |
unsigned int | GetNumPixels (void) const |
ColorID | GetPixel (unsigned int a_X, unsigned int a_Z) |
unsigned int | GetPixelWidth (void) const |
unsigned int | GetScale (void) const |
unsigned int | GetWidth (void) const |
cWorld * | GetWorld (void) |
void | Resize (unsigned int a_Width, unsigned int a_Height) |
bool | SetPixel (unsigned int a_X, unsigned int a_Z, ColorID a_Data) |
void | SetPosition (int a_CenterX, int a_CenterZ) |
void | SetScale (unsigned int a_Scale) |
void | Tick () |
Sends a map update to all registered clients Clears the list holding registered clients and decorators. More... | |
void | UpdateClient (cPlayer *a_Player) |
Send next update packet to the specified player and remove invalid decorators / clients. More... | |
void | UpdateRadius (cPlayer &a_Player, unsigned int a_Radius) |
Update a circular region around the specified player. More... | |
void | UpdateRadius (int a_PixelX, int a_PixelZ, unsigned int a_Radius) |
Update a circular region with the specified radius and center (in pixels). More... | |
Private Member Functions | |
bool | UpdatePixel (unsigned int a_X, unsigned int a_Z) |
Update the specified pixel. More... | |
Private Attributes | |
int | m_CenterX |
int | m_CenterZ |
cMapClientList | m_ClientsInCurrentTick |
cColorList | m_Data |
Column-major array of colours. More... | |
cMapDecoratorList | m_Decorators |
unsigned int | m_Height |
unsigned int | m_ID |
AString | m_Name |
unsigned int | m_Scale |
The zoom level, 2^scale square blocks per pixel. More... | |
unsigned int | m_Width |
cWorld * | m_World |
Friends | |
class | cMapSerializer |
typedef std::vector<ColorID> cMap::cColorList |
typedef std::vector<cClientHandle *> cMap::cMapClientList |
typedef std::vector<cMapDecorator> cMap::cMapDecoratorList |
typedef Byte cMap::ColorID |
enum cMap::eBaseColor |
cMap::cMap | ( | unsigned int | a_ID, |
cWorld * | a_World | ||
) |
cMap::cMap | ( | unsigned int | a_ID, |
int | a_CenterX, | ||
int | a_CenterZ, | ||
cWorld * | a_World, | ||
unsigned int | a_Scale = 3 |
||
) |
const cMapDecorator cMap::CreateDecorator | ( | const cEntity * | a_TrackedEntity | ) |
|
inline |
|
inline |
eDimension cMap::GetDimension | ( | void | ) | const |
cMap::ColorID cMap::GetPixel | ( | unsigned int | a_X, |
unsigned int | a_Z | ||
) |
void cMap::Resize | ( | unsigned int | a_Width, |
unsigned int | a_Height | ||
) |
bool cMap::SetPixel | ( | unsigned int | a_X, |
unsigned int | a_Z, | ||
cMap::ColorID | a_Data | ||
) |
void cMap::Tick | ( | ) |
void cMap::UpdateClient | ( | cPlayer * | a_Player | ) |
|
private |
void cMap::UpdateRadius | ( | cPlayer & | a_Player, |
unsigned int | a_Radius | ||
) |
void cMap::UpdateRadius | ( | int | a_PixelX, |
int | a_PixelZ, | ||
unsigned int | a_Radius | ||
) |
|
friend |
|
private |
|
private |
|
private |
|
private |