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
|
|
|
|
|
|
|
cFallingBlock(const Vector3i & a_BlockPosition, BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
virtual void Initialize(cWorld * a_World) override;
|
|
|
|
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
|
|
|
virtual void Tick(float a_Dt) override;
|
2012-12-21 07:21:20 -05:00
|
|
|
|
2012-09-30 12:37:44 -04:00
|
|
|
private:
|
|
|
|
BLOCKTYPE m_BlockType;
|
|
|
|
Vector3i m_OriginalPosition;
|
|
|
|
|
|
|
|
float m_SpeedY;
|
|
|
|
|
2012-12-21 07:21:20 -05:00
|
|
|
static bool IsPassable(BLOCKTYPE a_BlockType)
|
2012-09-30 12:37:44 -04:00
|
|
|
{
|
2012-12-21 07:21:20 -05:00
|
|
|
return ((a_BlockType == E_BLOCK_AIR) || IsBlockLiquid(a_BlockType));
|
2012-09-30 12:37:44 -04:00
|
|
|
}
|
2012-12-21 07:21:20 -05:00
|
|
|
} ;
|
2012-09-30 12:37:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|