2012-02-13 16:47:03 -05:00
|
|
|
|
2011-10-03 14:41:19 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
#include "BlockID.h"
|
|
|
|
#else
|
|
|
|
enum ENUM_BLOCK_ID;
|
|
|
|
#endif
|
|
|
|
|
2012-02-13 16:47:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-03 14:41:19 -04:00
|
|
|
class cClientHandle;
|
|
|
|
class cPlayer;
|
2012-02-13 16:47:03 -05:00
|
|
|
class cWorld;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-10-03 14:41:19 -04:00
|
|
|
class cBlockEntity
|
|
|
|
{
|
|
|
|
protected:
|
2012-02-13 16:47:03 -05:00
|
|
|
cBlockEntity(ENUM_BLOCK_ID a_BlockType, int a_X, int a_Y, int a_Z, cWorld * a_World)
|
2011-10-30 20:52:20 -04:00
|
|
|
: m_PosX( a_X )
|
|
|
|
, m_PosY( a_Y )
|
|
|
|
, m_PosZ( a_Z )
|
|
|
|
, m_BlockType( a_BlockType )
|
|
|
|
{}
|
2011-10-03 14:41:19 -04:00
|
|
|
public:
|
|
|
|
virtual ~cBlockEntity() {};
|
|
|
|
virtual void Destroy() {};
|
2011-11-06 04:23:20 -05:00
|
|
|
|
2011-10-03 14:41:19 -04:00
|
|
|
int GetPosX() { return m_PosX; }
|
|
|
|
int GetPosY() { return m_PosY; }
|
|
|
|
int GetPosZ() { return m_PosZ; }
|
|
|
|
|
|
|
|
ENUM_BLOCK_ID GetBlockType() { return m_BlockType; }
|
2012-02-13 16:47:03 -05:00
|
|
|
|
|
|
|
cWorld * GetWorld(void) const {return m_World; }
|
2011-10-03 14:41:19 -04:00
|
|
|
|
|
|
|
virtual void UsedBy( cPlayer & a_Player ) = 0;
|
|
|
|
virtual void SendTo( cClientHandle* a_Client ) { (void)a_Client; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int m_PosX; // Position in block coordinates
|
|
|
|
int m_PosY;
|
|
|
|
int m_PosZ;
|
|
|
|
|
|
|
|
ENUM_BLOCK_ID m_BlockType;
|
2012-02-13 16:47:03 -05:00
|
|
|
|
|
|
|
cWorld * m_World;
|
2011-10-03 14:41:19 -04:00
|
|
|
};
|
2012-02-13 16:47:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|