summary refs log tree commit diff stats
path: root/src/message_system.h
blob: 4dd01661ba4acf25e3c8667c04b00c3bceaba9bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef MESSAGE_SYSTEM_H_DE10D011
#define MESSAGE_SYSTEM_H_DE10D011

#include "system.h"

class Game;

class MessageSystem : public System {
public:

  static constexpr SystemKey Key = SystemKey::Message;

  MessageSystem(Game& game) : game_(game) {}

  void tick(double dt) override;

  // Commands

  void displayCutsceneBars();

  void hideCutsceneBars();

  // Info

  double getCutsceneBarsProgress() const;

private:

  enum class BarsState {
    Closed,
    Opening,
    Open,
    Closing
  };

  Game& game_;
  BarsState barsState_ = BarsState::Closed;
  double accum_ = 0.0;
  double length_ = 1000.0/8;
};

#endif /* end of include guard: MESSAGE_SYSTEM_H_DE10D011 */