about summary refs log tree commit diff stats
path: root/ap_state.h
blob: 5f9e952c24883b69850cd1bd17efb0957f5df596 (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
#ifndef AP_STATE_H_664A4180
#define AP_STATE_H_664A4180

#include <apclient.hpp>
#include <memory>
#include <mutex>
#include <set>
#include <string>

#include "game_data.h"
#include "tracker_frame.h"

class APState {
 public:
  APState();

  void SetTrackerFrame(TrackerFrame* tracker_frame) {
    tracker_frame_ = tracker_frame;
  }

  void Connect(std::string server, std::string player, std::string password);

 private:
  TrackerFrame* tracker_frame_;

  std::unique_ptr<APClient> apclient_;
  bool client_active_ = false;
  std::mutex client_mutex_;

  std::set<int> inventory_;
  std::set<int> checked_locations_;

  std::map<int, int> ap_id_by_location_id_;
  std::map<int, int> ap_id_by_door_id_;
  std::map<int, int> ap_id_by_door_group_id_;
  std::map<LingoColor, int> ap_id_by_color_;
};

APState& GetAPState();

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