1
0
Fork 0
cuberite-2a/src/Entities/FireworkEntity.h

65 lines
1.3 KiB
C
Raw Normal View History

// FireworkEntity.h
// Declares the cFireworkEntity class representing the flying firework rocket
#pragma once
#include "ProjectileEntity.h"
2014-04-27 00:58:06 +00:00
// tolua_begin
class cFireworkEntity :
public cProjectileEntity
{
// tolua_end
2016-02-05 21:45:45 +00:00
2020-04-13 16:38:06 +00:00
using Super = cProjectileEntity;
2016-02-05 21:45:45 +00:00
public: // tolua_export
2016-02-05 21:45:45 +00:00
CLASS_PROTODEF(cFireworkEntity)
2016-02-05 21:45:45 +00:00
cFireworkEntity(cEntity * a_Creator, Vector3d a_Pos, const cItem & a_Item);
// tolua_begin
/** Returns the item used to create the rocket (has all the firework effects on it) */
const cItem & GetItem(void) const { return m_FireworkItem; }
/** Sets the item that is used to create the rocket (has all the firework effects on it) */
void SetItem(const cItem & a_Item) { m_FireworkItem = a_Item; }
/** Returns the number of ticks left until the firework explosion. */
int GetTicksToExplosion(void) const { return m_TicksToExplosion; }
/** Sets the number of ticks left until the firework explosion. */
void SetTicksToExplosion(int a_TicksToExplosion) { m_TicksToExplosion = a_TicksToExplosion; }
// tolua_end
2016-02-05 21:45:45 +00:00
protected:
2016-02-05 21:45:45 +00:00
// cProjectileEntity overrides:
virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
2016-02-05 21:45:45 +00:00
private:
2016-02-05 21:45:45 +00:00
int m_TicksToExplosion;
cItem m_FireworkItem;
2016-02-05 21:45:45 +00:00
}; // tolua_export