2012-09-30 12:37:44 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Entity.h"
|
|
|
|
#include "Defines.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cPlayer;
|
|
|
|
class cItem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-21 07:21:20 -05:00
|
|
|
class cFallingBlock :
|
|
|
|
public cEntity
|
2012-09-30 12:37:44 -04:00
|
|
|
{
|
|
|
|
typedef cEntity super;
|
2012-12-21 07:21:20 -05:00
|
|
|
|
2012-09-30 12:37:44 -04:00
|
|
|
public:
|
2012-12-21 07:21:20 -05:00
|
|
|
CLASS_PROTODEF(cFallingBlock);
|
2012-09-30 12:37:44 -04:00
|
|
|
|
2013-05-19 07:49:01 -04:00
|
|
|
/// Creates a new falling block. a_BlockPosition is expected in world coords
|
2013-03-02 14:57:09 -05:00
|
|
|
cFallingBlock(const Vector3i & a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
|
2012-09-30 12:37:44 -04:00
|
|
|
|
2013-03-02 14:57:09 -05:00
|
|
|
BLOCKTYPE GetBlockType(void) const { return m_BlockType; }
|
|
|
|
NIBBLETYPE GetBlockMeta(void) const { return m_BlockMeta; }
|
2012-12-26 04:12:00 -05:00
|
|
|
|
|
|
|
// cEntity overrides:
|
2012-09-30 12:37:44 -04:00
|
|
|
virtual void Initialize(cWorld * a_World) override;
|
|
|
|
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
2013-04-13 17:02:10 -04:00
|
|
|
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
2012-12-21 07:21:20 -05:00
|
|
|
|
2012-09-30 12:37:44 -04:00
|
|
|
private:
|
2013-03-02 14:57:09 -05:00
|
|
|
BLOCKTYPE m_BlockType;
|
|
|
|
NIBBLETYPE m_BlockMeta;
|
2013-05-19 07:49:01 -04:00
|
|
|
Vector3i m_OriginalPosition; // Position where the falling block has started, in world coords
|
2012-12-21 07:21:20 -05:00
|
|
|
} ;
|
2012-09-30 12:37:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|