Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarPlayerLog.hpp
blob: 61993bb9b2da50e6d54b07bc0af2de9442e55cbd (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once

#include "StarSet.hpp"
#include "StarJson.hpp"

namespace Star {

STAR_CLASS(PlayerLog);

class PlayerLog {
public:
  PlayerLog();
  PlayerLog(Json const& json);

  Json toJson() const;

  int deathCount() const;
  void addDeathCount(int deaths);

  double playTime() const;
  void addPlayTime(double elapsedTime);

  bool introComplete() const;
  void setIntroComplete(bool complete);

  StringSet scannedObjects() const;
  bool addScannedObject(String const& objectName);
  void removeScannedObject(String const& objectName);
  void clearScannedObjects();

  StringSet radioMessages() const;
  bool addRadioMessage(String const& messageName);
  void clearRadioMessages();

  StringSet cinematics() const;
  bool addCinematic(String const& cinematic);
  void clearCinematics();

  StringList collections() const;
  StringSet collectables(String const& collection) const;
  bool addCollectable(String const& collection, String const& collectable);
  void clearCollectables(String const& collection);

private:
  int m_deathCount;
  double m_playTime;
  bool m_introComplete;
  StringSet m_scannedObjects;
  StringSet m_radioMessages;
  StringSet m_cinematics;
  StringMap<StringSet> m_collections;
};

}