DDNet documentation
Loading...
Searching...
No Matches
dragger.h
Go to the documentation of this file.
1/* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */
2#ifndef GAME_SERVER_ENTITIES_DRAGGER_H
3#define GAME_SERVER_ENTITIES_DRAGGER_H
4
6
7#include <optional>
8
9class CDraggerBeam;
10
25class CDragger : public CEntity
26{
27 // m_Core is the direction vector by which a dragger is shifted at each movement tick (every 150ms)
29 float m_Strength;
30 bool m_IgnoreWalls;
32
35
37 // Returns the client id of the dragger beam that is snapped with the dragger's id
38 // for the given snapping client, if there is one
39 std::optional<int> DraggerBeamUsingDraggerId(int SnappingClientId);
40
41public:
42 CDragger(CGameWorld *pGameWorld, vec2 Pos, float Strength, bool IgnoreWalls, int Layer = 0, int Number = 0);
43
44 void RemoveDraggerBeam(int ClientId);
45 bool WillDraggerBeamUseDraggerId(int TargetClientId, int SnappingClientId);
46
47 void Reset() override;
48 void Tick() override;
49 void Snap(int SnappingClient) override;
50 void SwapClients(int Client1, int Client2) override;
51};
52
53#endif // GAME_SERVER_ENTITIES_DRAGGER_H
Definition dragger_beam.h:25
Definition dragger.h:10
bool WillDraggerBeamUseDraggerId(int TargetClientId, int SnappingClientId)
Definition dragger.cpp:182
void Snap(int SnappingClient) override
Definition dragger.cpp:192
void SwapClients(int Client1, int Client2) override
Definition dragger.cpp:237
float m_Strength
Definition dragger.h:12
void RemoveDraggerBeam(int ClientId)
Definition dragger.cpp:152
void Tick() override
int m_EvalTick
Definition dragger.h:31
vec2 m_Core
Definition dragger.h:11
std::optional< int > DraggerBeamUsingDraggerId(int SnappingClientId)
Definition dragger.cpp:157
int m_aTargetIdInTeam[MAX_CLIENTS]
Definition dragger.h:33
void Reset() override
Definition dragger.cpp:187
CDraggerBeam * m_apDraggerBeam[MAX_CLIENTS]
Definition dragger.h:34
CDragger(CGameWorld *pGameWorld, int Id, const CLaserData *pData)
Definition dragger.cpp:131
bool m_IgnoreWalls
Definition dragger.h:13
void LookForPlayersToDrag()
Definition entity.h:13
friend CGameWorld
Definition entity.h:17
@ MAX_CLIENTS
Definition protocol.h:89
vector2_base< float > vec2
Definition vmath.h:168