Debian Codegraph @

Sources/Jazz2/Actors/Multiplayer/RemotablePlayer.h

raw
1 #pragma once
2
3 #if defined(WITH_MULTIPLAYER) || defined(DOXYGEN_GENERATING_OUTPUT)
4
5 #include "MpPlayer.h"
6
7 namespace Jazz2::Actors::Multiplayer
8 {
9 /** @brief Remotable player in online session */
10 class RemotablePlayer : public MpPlayer
11 {
12 DEATH_RUNTIME_OBJECT(MpPlayer);
13
14 public:
15 /** @brief Whether current weapon is being changed by the server */
16 bool ChangingWeaponFromServer;
17
18 /** @brief Whether the player should be respawned */
19 bool RespawnPending;
20
21 /** @brief The position at which the player should respawn */
22 Vector2f RespawnPos;
23
24 RemotablePlayer(std::shared_ptr<PeerDescriptor> peerDesc);
25
26 /** @brief Warps the player in */
27 void WarpIn(ExitType exitType);
28 /** @brief Moves the player remotely */
29 void MoveRemotely(Vector2f pos, Vector2f speed);
30
31 bool Respawn(Vector2f pos) override;
32
33 protected:
34 Task<bool> OnActivatedAsync(const ActorActivationDetails& details) override;
35 bool OnPerish(ActorBase* collider) override;
36 void OnUpdate(float timeMult) override;
37
38 void OnWaterSplash(Vector2f pos, bool inwards) override;
39
40 bool FireCurrentWeapon(WeaponType weaponType) override;
41 void SetCurrentWeapon(WeaponType weaponType, SetCurrentWeaponReason reason) override;
42
43 private:
44 bool _warpPending;
45 };
46 }
47
48 #endif