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_SERVER_ENTITIES_LASER_H
4#define GAME_SERVER_ENTITIES_LASER_H
5
7
8class CLaser : public CEntity
9{
10public:
11 CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Type);
12
13 virtual void Reset() override;
14 virtual void Tick() override;
15 virtual void TickPaused() override;
16 virtual void Snap(int SnappingClient) override;
17 virtual void SwapClients(int Client1, int Client2) override;
18
19 virtual int GetOwnerId() const override { return m_Owner; }
20
21protected:
22 bool HitCharacter(vec2 From, vec2 To);
23 void DoBounce();
24
25private:
27 vec2 m_Dir;
30 float m_Energy;
31 int m_Bounces;
32 int m_EvalTick;
33 int m_Owner;
36
37 // DDRace
38
40 int m_Type;
41 int m_TuneZone;
45};
46
47#endif
Definition: entity.h:13
Definition: gameworld.h:17
Definition: laser.h:11
int m_Bounces
Definition: laser.h:34
virtual void Reset() override
Definition: laser.cpp:262
virtual void Snap(int SnappingClient) override
Definition: laser.cpp:293
bool m_TeleportCancelled
Definition: laser.h:42
void DoBounce()
vec2 m_PrevPos
Definition: laser.h:41
CClientMask m_TeamMask
Definition: laser.h:34
bool HitCharacter(vec2 From, vec2 To)
CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Type)
int m_Type
Definition: laser.h:42
bool m_ZeroEnergyBounceInLastTick
Definition: laser.h:37
vec2 m_TelePos
Definition: laser.h:28
bool m_IsBlueTeleport
Definition: laser.h:43
virtual void Tick() override
float m_Energy
Definition: laser.h:33
bool m_WasTele
Definition: laser.h:29
int m_TuneZone
Definition: laser.h:43
vec2 m_From
Definition: laser.h:31
virtual void TickPaused() override
Definition: laser.cpp:288
bool m_BelongsToPracticeTeam
Definition: laser.h:44
int m_Owner
Definition: laser.h:36
vec2 m_Dir
Definition: laser.h:32
int m_EvalTick
Definition: laser.h:35
virtual void SwapClients(int Client1, int Client2) override
Definition: laser.cpp:322
virtual int GetOwnerId() const override
Definition: laser.h:19
std::bitset< MAX_CLIENTS > CClientMask
Definition: protocol.h:132