2012-09-30 09:37:44 -07:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Entity.h"
|
|
|
|
#include "Defines.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cPlayer;
|
|
|
|
class cItem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-21 04:21:20 -08:00
|
|
|
class cFallingBlock :
|
|
|
|
public cEntity
|
2012-09-30 09:37:44 -07:00
|
|
|
{
|
|
|
|
typedef cEntity super;
|
2012-12-21 04:21:20 -08:00
|
|
|
|
2012-09-30 09:37:44 -07:00
|
|
|
public:
|
2012-12-21 04:21:20 -08:00
|
|
|
CLASS_PROTODEF(cFallingBlock);
|
2012-09-30 09:37:44 -07:00
|
|
|
|
|
|
|
cFallingBlock(const Vector3i & a_BlockPosition, BLOCKTYPE a_BlockType);
|
|
|
|
|
2012-12-26 01:12:00 -08:00
|
|
|
BLOCKTYPE GetBlockType(void) const { return m_BlockType; }
|
|
|
|
|
|
|
|
// cEntity overrides:
|
2012-09-30 09:37:44 -07:00
|
|
|
virtual void Initialize(cWorld * a_World) override;
|
|
|
|
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
2012-12-22 02:15:53 -08:00
|
|
|
virtual void Tick(float a_Dt, MTRand & a_TickRandom) override;
|
2012-12-21 04:21:20 -08:00
|
|
|
|
2012-09-30 09:37:44 -07:00
|
|
|
private:
|
|
|
|
BLOCKTYPE m_BlockType;
|
|
|
|
Vector3i m_OriginalPosition;
|
|
|
|
|
2012-12-21 04:21:20 -08:00
|
|
|
static bool IsPassable(BLOCKTYPE a_BlockType)
|
2012-09-30 09:37:44 -07:00
|
|
|
{
|
2012-12-21 04:21:20 -08:00
|
|
|
return ((a_BlockType == E_BLOCK_AIR) || IsBlockLiquid(a_BlockType));
|
2012-09-30 09:37:44 -07:00
|
|
|
}
|
2012-12-21 04:21:20 -08:00
|
|
|
} ;
|
2012-09-30 09:37:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|