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 | |
6 | #include <game/client/prediction/entity.h> |
7 | |
8 | class CProjectileData; |
9 | |
10 | class CProjectile : public CEntity |
11 | { |
12 | friend class CGameWorld; |
13 | friend class CItems; |
14 | |
15 | public: |
16 | CProjectile( |
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); |
30 | CProjectileData GetData() const; |
31 | |
32 | void Tick() override; |
33 | |
34 | bool Match(CProjectile *pProj); |
35 | void SetBouncing(int Value); |
36 | |
37 | const vec2 &GetDirection() { return m_Direction; } |
38 | const int &GetOwner() { return m_Owner; } |
39 | const int &GetStartTick() { return m_StartTick; } |
40 | CProjectile(CGameWorld *pGameWorld, int Id, const CProjectileData *pProj); |
41 | |
42 | private: |
43 | vec2 m_Direction; |
44 | int m_LifeSpan; |
45 | int m_Owner; |
46 | int m_Type; |
47 | int m_SoundImpact; |
48 | float m_Force; |
49 | int m_StartTick; |
50 | bool m_Explosive; |
51 | |
52 | // DDRace |
53 | |
54 | int m_Bouncing; |
55 | bool m_Freeze; |
56 | int m_TuneZone; |
57 | }; |
58 | |
59 | #endif |
60 | |