about summary refs log tree commit diff stats
path: root/src/network_set.h
diff options
context:
space:
mode:
authorart0007i <art0007i@gmail.com>2024-09-24 15:11:32 +0200
committerStar Rauchenberger <fefferburbia@gmail.com>2024-09-24 09:38:26 -0400
commit738d970d26794db8bb3dcf459c4a787b624910ba (patch)
treec5ea9e5eed9ebbab72f5a6cdfc84ca684816001f /src/network_set.h
parent46f46b4caa0fbaba77ac2b2291d908d3bf81dd28 (diff)
downloadlingo-ap-tracker-738d970d26794db8bb3dcf459c4a787b624910ba.tar.gz
lingo-ap-tracker-738d970d26794db8bb3dcf459c4a787b624910ba.tar.bz2
lingo-ap-tracker-738d970d26794db8bb3dcf459c4a787b624910ba.zip
make paintings 1 directional and add "arrows" the "arrows" are circles because I couldn't figure out how to use the DrawPolygon function...
Diffstat (limited to 'src/network_set.h')
-rw-r--r--src/network_set.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/network_set.h b/src/network_set.h index cec3f39..0f72052 100644 --- a/src/network_set.h +++ b/src/network_set.h
@@ -7,21 +7,29 @@
7#include <utility> 7#include <utility>
8#include <vector> 8#include <vector>
9 9
10struct NetworkNode {
11 int entry;
12 int exit;
13 bool two_way;
14
15 bool operator<(const NetworkNode& rhs) const;
16};
17
10class NetworkSet { 18class NetworkSet {
11 public: 19 public:
12 void Clear(); 20 void Clear();
13 21
14 void AddLink(int id1, int id2); 22 void AddLink(int id1, int id2, bool two_way);
15 23
16 void AddLinkToNetwork(int network_id, int id1, int id2); 24 void AddLinkToNetwork(int network_id, int id1, int id2, bool two_way);
17 25
18 bool IsItemInNetwork(int id) const; 26 bool IsItemInNetwork(int id) const;
19 27
20 const std::set<std::pair<int, int>>& GetNetworkGraph(int id) const; 28 const std::set<NetworkNode>& GetNetworkGraph(int id) const;
21 29
22 private: 30 private:
23 31
24 std::map<int, std::set<std::pair<int, int>>> network_by_item_; 32 std::map<int, std::set<NetworkNode>> network_by_item_;
25}; 33};
26 34
27#endif /* end of include guard: NETWORK_SET_H_3036B8E3 */ 35#endif /* end of include guard: NETWORK_SET_H_3036B8E3 */