about summary refs log tree commit diff stats
path: root/src/network_set.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-05-14 11:41:50 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-05-14 11:41:50 -0400
commit7f4b6b4f0cb276a7e0868c7e97d862b1feb468d3 (patch)
tree101ca3148d5470db821d1572c8f795dd5ad61759 /src/network_set.h
parent34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13 (diff)
downloadlingo-ap-tracker-7f4b6b4f0cb276a7e0868c7e97d862b1feb468d3.tar.gz
lingo-ap-tracker-7f4b6b4f0cb276a7e0868c7e97d862b1feb468d3.tar.bz2
lingo-ap-tracker-7f4b6b4f0cb276a7e0868c7e97d862b1feb468d3.zip
Hovered connections on subway map!
Diffstat (limited to 'src/network_set.h')
-rw-r--r--src/network_set.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/network_set.h b/src/network_set.h new file mode 100644 index 0000000..e0ef043 --- /dev/null +++ b/src/network_set.h
@@ -0,0 +1,28 @@
1#ifndef NETWORK_SET_H_3036B8E3
2#define NETWORK_SET_H_3036B8E3
3
4#include <map>
5#include <optional>
6#include <set>
7#include <utility>
8#include <vector>
9
10class NetworkSet {
11 public:
12 void Clear();
13
14 int AddLink(int id1, int id2);
15
16 bool IsItemInNetwork(int id) const;
17
18 int GetNetworkWithItem(int id) const;
19
20 const std::set<std::pair<int, int>>& GetNetworkGraph(int id) const;
21
22 private:
23
24 std::vector<std::set<std::pair<int, int>>> networks_;
25 std::map<int, int> network_by_item_;
26};
27
28#endif /* end of include guard: NETWORK_SET_H_3036B8E3 */