Debian Codegraph @

Sources/Jazz2/Actors/Environment/Copter.h

raw
1 #pragma once
2
3 #include "../ActorBase.h"
4
5 namespace Jazz2::Actors::Environment
6 {
7 /** @brief Copter */
8 class Copter : public ActorBase
9 {
10 DEATH_RUNTIME_OBJECT(ActorBase);
11
12 public:
13 Copter();
14 ~Copter();
15
16 static void Preload(const ActorActivationDetails& details);
17
18 bool OnHandleCollision(std::shared_ptr<ActorBase> other) override;
19
20 /** @brief Unmounts from the assigned actor */
21 void Unmount(float timeLeft);
22
23 protected:
24 Task<bool> OnActivatedAsync(const ActorActivationDetails& details) override;
25 void OnUpdate(float timeMult) override;
26 void OnDetach(ActorBase* parent) override;
27
28 private:
29 enum class State {
30 Free,
31 Unmounted,
32 Mounted
33 };
34
35 Vector2f _originPos;
36 float _phase;
37 State _state;
38 #if defined(WITH_AUDIO)
39 std::shared_ptr<AudioBufferPlayer> _noise;
40 #endif
41 float _noiseDec;
42 };
43 }