DDraceNetwork Docs
laser.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef GAME_CLIENT_PREDICTION_ENTITIES_LASER_H
4#define GAME_CLIENT_PREDICTION_ENTITIES_LASER_H
5
7
8class CLaserData;
9
10class CLaser : public CEntity
11{
12 friend class CGameWorld;
13
14public:
15 CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Type);
16
17 void Tick() override;
18
19 const vec2 &GetFrom() { return m_From; }
20 const int &GetOwner() { return m_Owner; }
21 const int &GetEvalTick() { return m_EvalTick; }
22 CLaser(CGameWorld *pGameWorld, int Id, CLaserData *pLaser);
23 bool Match(CLaser *pLaser);
24 CLaserData GetData() const;
25
26protected:
27 bool HitCharacter(vec2 From, vec2 To);
28 void DoBounce();
29
30private:
33 float m_Energy;
38
39 // DDRace
40
42 int m_Type;
44};
45
46#endif
Definition: entity.h:13
Definition: gameworld.h:17
Definition: laser_data.h:13
Definition: laser.h:11
int m_Bounces
Definition: laser.h:34
void Tick() override
Definition: laser.cpp:165
void DoBounce()
Definition: laser.cpp:92
vec2 m_PrevPos
Definition: laser.h:41
CLaserData GetData() const
Definition: laser.cpp:215
bool HitCharacter(vec2 From, vec2 To)
Definition: laser.cpp:30
const vec2 & GetFrom()
Definition: laser.h:19
CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Type)
Definition: laser.cpp:12
int m_Type
Definition: laser.h:42
bool m_ZeroEnergyBounceInLastTick
Definition: laser.h:37
float m_Energy
Definition: laser.h:33
int m_TuneZone
Definition: laser.h:43
vec2 m_From
Definition: laser.h:31
bool Match(CLaser *pLaser)
Definition: laser.cpp:203
const int & GetOwner()
Definition: laser.h:20
int m_Owner
Definition: laser.h:36
vec2 m_Dir
Definition: laser.h:32
int m_EvalTick
Definition: laser.h:35
const int & GetEvalTick()
Definition: laser.h:21