Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Macros
Entity.h File Reference
#include "../BoundingBox.h"
#include "../Item.h"
#include "../OSSupport/AtomicUniquePtr.h"
Include dependency graph for Entity.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cEntity
 
struct  cEntity::sPortalCooldownData
 Structure storing the portal delay timer and cooldown boolean. More...
 
struct  cEntity::sWorldChangeInfo
 State variables for MoveToWorld. More...
 
struct  TakeDamageInfo
 

Macros

#define CLASS_PROTODEF(classname)
 
#define GET_AND_VERIFY_CURRENT_CHUNK(ChunkVarName, X, Z)
 
#define POS_TOINT   GetPosition().Floor()
 
#define POSX_TOINT   FloorC(GetPosX())
 
#define POSY_TOINT   FloorC(GetPosY())
 
#define POSZ_TOINT   FloorC(GetPosZ())
 

Macro Definition Documentation

◆ CLASS_PROTODEF

#define CLASS_PROTODEF (   classname)
Value:
virtual bool IsA(const char * a_ClassName) const override\
{ \
return ((a_ClassName != nullptr) && ((strcmp(a_ClassName, #classname) == 0) || Super::IsA(a_ClassName))); \
} \
virtual const char * GetClass(void) const override \
{ \
return #classname; \
} \
static const char * GetClassStatic(void) \
{ \
return #classname; \
} \
virtual const char * GetParentClass(void) const override \
{ \
return Super::GetClass(); \
}

Definition at line 13 of file Entity.h.

◆ GET_AND_VERIFY_CURRENT_CHUNK

#define GET_AND_VERIFY_CURRENT_CHUNK (   ChunkVarName,
  X,
 
)
Value:
cChunk * ChunkVarName = a_Chunk.GetNeighborChunk(X, Z); \
do { \
if ((ChunkVarName == nullptr) || !ChunkVarName->IsValid()) \
{ \
return; \
} \
} while (false)
Definition: Chunk.h:36
cChunk * GetNeighborChunk(int a_BlockX, int a_BlockZ)
Returns the chunk into which the specified block belongs, by walking the neighbors.
Definition: Chunk.cpp:1806
bool IsValid(void) const
Returns true iff the chunk block data is valid (loaded / generated)
Definition: Chunk.h:58

Definition at line 36 of file Entity.h.

◆ POS_TOINT

#define POS_TOINT   GetPosition().Floor()

Definition at line 34 of file Entity.h.

◆ POSX_TOINT

#define POSX_TOINT   FloorC(GetPosX())

Definition at line 31 of file Entity.h.

◆ POSY_TOINT

#define POSY_TOINT   FloorC(GetPosY())

Definition at line 32 of file Entity.h.

◆ POSZ_TOINT

#define POSZ_TOINT   FloorC(GetPosZ())

Definition at line 33 of file Entity.h.