about summary refs log tree commit diff stats
path: root/ap_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'ap_state.h')
-rw-r--r--ap_state.h66
1 files changed, 12 insertions, 54 deletions
diff --git a/ap_state.h b/ap_state.h index ce73528..434b7b2 100644 --- a/ap_state.h +++ b/ap_state.h
@@ -1,73 +1,31 @@
1#ifndef AP_STATE_H_664A4180 1#ifndef AP_STATE_H_664A4180
2#define AP_STATE_H_664A4180 2#define AP_STATE_H_664A4180
3 3
4#include <memory> 4#include <map>
5#include <mutex>
6#include <set>
7#include <string> 5#include <string>
8#include <tuple>
9 6
10#include "game_data.h" 7#include "game_data.h"
11#include "tracker_frame.h"
12 8
13enum DoorShuffleMode { kNO_DOORS = 0, kSIMPLE_DOORS = 1, kCOMPLEX_DOORS = 2 }; 9class TrackerFrame;
14
15class APState {
16 public:
17 APState();
18
19 void SetTrackerFrame(TrackerFrame* tracker_frame) {
20 tracker_frame_ = tracker_frame;
21 }
22
23 void Connect(std::string server, std::string player, std::string password);
24
25 bool HasCheckedGameLocation(int area_id, int section_id) const;
26
27 bool HasColorItem(LingoColor color) const;
28
29 bool HasItem(const std::string& item, int quantity = 1) const;
30 10
31 DoorShuffleMode GetDoorShuffleMode() const { return door_shuffle_mode_; } 11enum DoorShuffleMode { kNO_DOORS = 0, kSIMPLE_DOORS = 1, kCOMPLEX_DOORS = 2 };
32
33 bool IsColorShuffle() const { return color_shuffle_; }
34
35 bool IsPaintingShuffle() const { return painting_shuffle_; }
36
37 const std::map<std::string, std::string> GetPaintingMapping() const {
38 return painting_mapping_;
39 }
40
41 private:
42 void RefreshTracker();
43
44 int64_t GetItemId(const std::string& item_name);
45 12
46 void DestroyClient(); 13void AP_SetTrackerFrame(TrackerFrame* tracker_frame);
47 14
48 TrackerFrame* tracker_frame_; 15void AP_Connect(std::string server, std::string player, std::string password);
49 16
50 bool client_active_ = false; 17bool AP_HasCheckedGameLocation(int area_id, int section_id);
51 std::mutex client_mutex_;
52 18
53 bool connected_ = false; 19bool AP_HasColorItem(LingoColor color);
54 bool has_connection_result_ = false;
55 20
56 std::map<int64_t, int> inventory_; 21bool AP_HasItem(const std::string& item, int quantity = 1);
57 std::set<int64_t> checked_locations_;
58 22
59 std::map<std::tuple<int, int>, int64_t> ap_id_by_location_id_; 23DoorShuffleMode AP_GetDoorShuffleMode();
60 std::map<std::string, int64_t> ap_id_by_item_name_;
61 std::map<LingoColor, int64_t> ap_id_by_color_;
62 std::map<int64_t, std::string> progressive_item_by_ap_id_;
63 24
64 DoorShuffleMode door_shuffle_mode_ = kNO_DOORS; 25bool AP_IsColorShuffle();
65 bool color_shuffle_ = false;
66 bool painting_shuffle_ = false;
67 26
68 std::map<std::string, std::string> painting_mapping_; 27bool AP_IsPaintingShuffle();
69};
70 28
71APState& GetAPState(); 29const std::map<std::string, std::string> AP_GetPaintingMapping();
72 30
73#endif /* end of include guard: AP_STATE_H_664A4180 */ 31#endif /* end of include guard: AP_STATE_H_664A4180 */