about summary refs log tree commit diff stats
path: root/src/network_set.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-07-24 13:36:07 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-07-24 13:36:07 -0400
commit4ffb5871e4bc54ab6765fcd738835c295d1e2924 (patch)
tree47d9521046ae6b628ec3b64d5a2890e6a26bcbbf /src/network_set.cpp
parent1a935f45c98905a20a13265ae0d00f9674ec4ea6 (diff)
downloadlingo-ap-tracker-4ffb5871e4bc54ab6765fcd738835c295d1e2924.tar.gz
lingo-ap-tracker-4ffb5871e4bc54ab6765fcd738835c295d1e2924.tar.bz2
lingo-ap-tracker-4ffb5871e4bc54ab6765fcd738835c295d1e2924.zip
Pilgrim Antechamber sunwarp now shows if pilgrimage is doable
Diffstat (limited to 'src/network_set.cpp')
-rw-r--r--src/network_set.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/network_set.cpp b/src/network_set.cpp index 6d2a098..2a9e12c 100644 --- a/src/network_set.cpp +++ b/src/network_set.cpp
@@ -21,6 +21,19 @@ void NetworkSet::AddLink(int id1, int id2) {
21 network_by_item_[id2].insert({id1, id2}); 21 network_by_item_[id2].insert({id1, id2});
22} 22}
23 23
24void NetworkSet::AddLinkToNetwork(int network_id, int id1, int id2) {
25 if (id2 > id1) {
26 // Make sure id1 < id2
27 std::swap(id1, id2);
28 }
29
30 if (!network_by_item_.count(network_id)) {
31 network_by_item_[network_id] = {};
32 }
33
34 network_by_item_[network_id].insert({id1, id2});
35}
36
24bool NetworkSet::IsItemInNetwork(int id) const { 37bool NetworkSet::IsItemInNetwork(int id) const {
25 return network_by_item_.count(id); 38 return network_by_item_.count(id);
26} 39}