From 4ffb5871e4bc54ab6765fcd738835c295d1e2924 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 24 Jul 2024 13:36:07 -0400 Subject: Pilgrim Antechamber sunwarp now shows if pilgrimage is doable --- src/network_set.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/network_set.cpp') 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) { network_by_item_[id2].insert({id1, id2}); } +void NetworkSet::AddLinkToNetwork(int network_id, int id1, int id2) { + if (id2 > id1) { + // Make sure id1 < id2 + std::swap(id1, id2); + } + + if (!network_by_item_.count(network_id)) { + network_by_item_[network_id] = {}; + } + + network_by_item_[network_id].insert({id1, id2}); +} + bool NetworkSet::IsItemInNetwork(int id) const { return network_by_item_.count(id); } -- cgit 1.4.1