DDNet documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
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
6
#include <
game/client/prediction/entity.h
>
7
8
class
CLaserData
;
9
10
class
CLaser
:
public
CEntity
11
{
12
friend
class
CGameWorld
;
13
14
public
:
15
CLaser
(
CGameWorld
*pGameWorld,
vec2
Pos,
vec2
Direction
,
float
StartEnergy,
int
Owner,
int
Type);
16
17
void
Tick
()
override
;
18
19
const
vec2
&
GetFrom
()
const
{
return
m_From
; }
20
const
int
&
GetOwner
()
const
{
return
m_Owner
; }
21
const
int
&
GetEvalTick
()
const
{
return
m_EvalTick
; }
22
CLaser
(
CGameWorld
*pGameWorld,
int
Id,
const
CLaserData
*pLaser);
23
bool
Match
(
CLaser
*pLaser);
24
CLaserData
GetData
()
const
;
25
26
protected
:
27
bool
HitCharacter
(
vec2
From,
vec2
To);
28
void
DoBounce
();
29
30
private
:
31
vec2
m_From
;
32
vec2
m_Dir
;
33
float
m_Energy
;
34
int
m_Bounces
;
35
int
m_EvalTick
;
36
int
m_Owner
;
37
bool
m_ZeroEnergyBounceInLastTick
;
38
39
// DDRace
40
41
vec2
m_PrevPos
;
42
int
m_Type
;
43
int
m_TuneZone
;
44
};
45
46
#endif
CEntity::CEntity
CEntity(CGameWorld *pGameWorld, int Objtype, vec2 Pos=vec2(0, 0), int ProximityRadius=0)
Definition
entity.cpp:11
CGameWorld
Definition
gameworld.h:18
CLaserData
Definition
laser_data.h:13
CLaser
Definition
laser.h:11
CLaser::m_Bounces
int m_Bounces
Definition
laser.h:34
CLaser::Tick
void Tick() override
Definition
laser.cpp:171
CLaser::GetFrom
const vec2 & GetFrom() const
Definition
laser.h:19
CLaser::GetEvalTick
const int & GetEvalTick() const
Definition
laser.h:21
CLaser::DoBounce
void DoBounce()
Definition
laser.cpp:96
CLaser::m_PrevPos
vec2 m_PrevPos
Definition
laser.h:41
CLaser::GetData
CLaserData GetData() const
Definition
laser.cpp:223
CLaser::HitCharacter
bool HitCharacter(vec2 From, vec2 To)
Definition
laser.cpp:33
CLaser::CLaser
CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Type)
Definition
laser.cpp:15
CLaser::m_Type
int m_Type
Definition
laser.h:42
CLaser::m_ZeroEnergyBounceInLastTick
bool m_ZeroEnergyBounceInLastTick
Definition
laser.h:37
CLaser::GetOwner
const int & GetOwner() const
Definition
laser.h:20
CLaser::m_Energy
float m_Energy
Definition
laser.h:33
CLaser::m_TuneZone
int m_TuneZone
Definition
laser.h:43
CLaser::m_From
vec2 m_From
Definition
laser.h:31
CLaser::Match
bool Match(CLaser *pLaser)
Definition
laser.cpp:211
CLaser::CGameWorld
friend class CGameWorld
Definition
laser.h:12
CLaser::m_Owner
int m_Owner
Definition
laser.h:36
CLaser::m_Dir
vec2 m_Dir
Definition
laser.h:32
CLaser::m_EvalTick
int m_EvalTick
Definition
laser.h:35
entity.h
Direction
Direction
Definition
nameplates.cpp:211
vec2
vector2_base< float > vec2
Definition
vmath.h:168
src
game
client
prediction
entities
laser.h
Generated by
1.18.0