Cuberite
A lightweight, fast and extensible game server for Minecraft
TNTEntity.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Entity.h"
5 
6 
7 
8 
9 // tolua_begin
10 class cTNTEntity:
11  public cEntity
12 {
13 
14  // tolua_end
15 
16  using Super = cEntity;
17 
18 public: // tolua_export
19 
21 
22  cTNTEntity(Vector3d a_Pos, unsigned a_FuseTicks = 80);
23 
24  // cEntity overrides:
25  virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
26  virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
27 
28  // tolua_begin
29 
31  void Explode(void);
32 
34  unsigned GetFuseTicks(void) const { return m_FuseTicks; }
35 
37  void SetFuseTicks(unsigned a_FuseTicks) { m_FuseTicks = a_FuseTicks; }
38 
39  // tolua_end
40 
41 protected:
42  unsigned m_FuseTicks;
43 }; // tolua_export
#define CLASS_PROTODEF(classname)
Definition: Entity.h:13
Definition: Chunk.h:36
Definition: Entity.h:76
cEntity(eEntityType a_EntityType, Vector3d a_Pos, float a_Width, float a_Height)
Definition: Entity.cpp:37
void SetFuseTicks(unsigned a_FuseTicks)
Set the fuse ticks until the tnt will explode.
Definition: TNTEntity.h:37
unsigned GetFuseTicks(void) const
Returns the fuse ticks until the tnt will explode.
Definition: TNTEntity.h:34
unsigned m_FuseTicks
How much ticks is left, while the tnt will explode.
Definition: TNTEntity.h:42
virtual void SpawnOn(cClientHandle &a_ClientHandle) override
Descendants override this function to send a command to the specified client to spawn the entity on t...
Definition: TNTEntity.cpp:23
cTNTEntity(Vector3d a_Pos, unsigned a_FuseTicks=80)
Definition: TNTEntity.cpp:11
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Definition: TNTEntity.cpp:50
void Explode(void)
Explode the tnt.
Definition: TNTEntity.cpp:34