DDraceNetwork Documentation
Loading...
Searching...
No Matches
projectile.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_PROJECTILE_H
4#define GAME_CLIENT_PREDICTION_ENTITIES_PROJECTILE_H
5
7
9
10class CProjectile : public CEntity
11{
12 friend class CGameWorld;
13 friend class CItems;
14
15public:
17 CGameWorld *pGameWorld,
18 int Type,
19 int Owner,
20 vec2 Pos,
21 vec2 Dir,
22 int Span,
23 bool Freeze,
24 bool Explosive,
25 int SoundImpact,
26 int Layer = 0,
27 int Number = 0);
28
29 vec2 GetPos(float Time);
31
32 void Tick() override;
33
34 bool Match(CProjectile *pProj);
35 void SetBouncing(int Value);
36
37 const vec2 &GetDirection() const { return m_Direction; }
38 const int &GetOwner() const { return m_Owner; }
39 const int &GetStartTick() const { return m_StartTick; }
40 CProjectile(CGameWorld *pGameWorld, int Id, const CProjectileData *pProj);
41
42private:
46 int m_Type;
48 float m_Force;
51
52 // DDRace
53
57};
58
59#endif
const vec2 & GetPos() const
Definition entity.h:41
CEntity(CGameWorld *pGameWorld, int Objtype, vec2 Pos=vec2(0, 0), int ProximityRadius=0)
Definition entity.cpp:11
Definition gameworld.h:18
Definition projectile_data.h:14
bool m_Freeze
Definition projectile.h:55
const int & GetStartTick() const
Definition projectile.h:39
int m_Bouncing
Definition projectile.h:54
bool Match(CProjectile *pProj)
Definition projectile.cpp:217
vec2 m_Direction
Definition projectile.h:43
void Tick() override
Definition projectile.cpp:74
int m_SoundImpact
Definition projectile.h:47
int m_Owner
Definition projectile.h:45
float m_Force
Definition projectile.h:48
CProjectile(CGameWorld *pGameWorld, int Type, int Owner, vec2 Pos, vec2 Dir, int Span, bool Freeze, bool Explosive, int SoundImpact, int Layer=0, int Number=0)
Definition projectile.cpp:15
int m_TuneZone
Definition projectile.h:56
void SetBouncing(int Value)
Definition projectile.cpp:155
const vec2 & GetDirection() const
Definition projectile.h:37
CProjectileData GetData() const
Definition projectile.cpp:200
bool m_Explosive
Definition projectile.h:50
int m_StartTick
Definition projectile.h:49
int m_LifeSpan
Definition projectile.h:44
int m_Type
Definition projectile.h:46
friend class CGameWorld
Definition projectile.h:12
friend class CItems
Definition projectile.h:13
const int & GetOwner() const
Definition projectile.h:38
vector2_base< float > vec2
Definition vmath.h:161