Cuberite
A lightweight, fast and extensible game server for Minecraft
FireworkEntity.h
Go to the documentation of this file.
1 
2 // FireworkEntity.h
3 
4 // Declares the cFireworkEntity class representing the flying firework rocket
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "ProjectileEntity.h"
13 
14 
15 
16 
17 
18 // tolua_begin
19 
21  public cProjectileEntity
22 {
23  // tolua_end
24 
26 
27 public: // tolua_export
28 
30 
31  cFireworkEntity(cEntity * a_Creator, Vector3d a_Pos, const cItem & a_Item);
32 
33  // tolua_begin
34 
36  const cItem & GetItem(void) const { return m_FireworkItem; }
37 
39  void SetItem(const cItem & a_Item) { m_FireworkItem = a_Item; }
40 
42  int GetTicksToExplosion(void) const { return m_TicksToExplosion; }
43 
45  void SetTicksToExplosion(int a_TicksToExplosion) { m_TicksToExplosion = a_TicksToExplosion; }
46 
47  // tolua_end
48 
49 protected:
50 
51  // cProjectileEntity overrides:
52  virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
53  virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
54 
55 private:
56 
59 
60 }; // tolua_export
61 
62 
63 
64 
#define CLASS_PROTODEF(classname)
Definition: Entity.h:13
Definition: Chunk.h:36
Definition: Entity.h:76
virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Handles the physics of the entity - updates position based on speed, updates speed based on environme...
int GetTicksToExplosion(void) const
Returns the number of ticks left until the firework explosion.
void SetItem(const cItem &a_Item)
Sets the item that is used to create the rocket (has all the firework effects on it)
const cItem & GetItem(void) const
Returns the item used to create the rocket (has all the firework effects on it)
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
void SetTicksToExplosion(int a_TicksToExplosion)
Sets the number of ticks left until the firework explosion.
cFireworkEntity(cEntity *a_Creator, Vector3d a_Pos, const cItem &a_Item)
cProjectileEntity(eKind a_Kind, cEntity *a_Creator, Vector3d a_Pos, float a_Width, float a_Height)
Definition: Item.h:37