diff options
Diffstat (limited to 'src/network_set.h')
-rw-r--r-- | src/network_set.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/network_set.h b/src/network_set.h index e6f0c07..0f72052 100644 --- a/src/network_set.h +++ b/src/network_set.h | |||
@@ -7,19 +7,29 @@ | |||
7 | #include <utility> | 7 | #include <utility> |
8 | #include <vector> | 8 | #include <vector> |
9 | 9 | ||
10 | struct NetworkNode { | ||
11 | int entry; | ||
12 | int exit; | ||
13 | bool two_way; | ||
14 | |||
15 | bool operator<(const NetworkNode& rhs) const; | ||
16 | }; | ||
17 | |||
10 | class NetworkSet { | 18 | class 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); |
23 | |||
24 | void AddLinkToNetwork(int network_id, int id1, int id2, bool two_way); | ||
15 | 25 | ||
16 | bool IsItemInNetwork(int id) const; | 26 | bool IsItemInNetwork(int id) const; |
17 | 27 | ||
18 | const std::set<std::pair<int, int>>& GetNetworkGraph(int id) const; | 28 | const std::set<NetworkNode>& GetNetworkGraph(int id) const; |
19 | 29 | ||
20 | private: | 30 | private: |
21 | 31 | ||
22 | std::map<int, std::set<std::pair<int, int>>> network_by_item_; | 32 | std::map<int, std::set<NetworkNode>> network_by_item_; |
23 | }; | 33 | }; |
24 | 34 | ||
25 | #endif /* end of include guard: NETWORK_SET_H_3036B8E3 */ | 35 | #endif /* end of include guard: NETWORK_SET_H_3036B8E3 */ |