#include "network_set.h" void NetworkSet::Clear() { network_by_item_.clear(); } void NetworkSet::AddLink(int id1, int id2) { if (id2 > id1) { // Make sure id1 < id2 std::swap(id1, id2); } if (!network_by_item_.count(id1)) { network_by_item_[id1] = {}; } if (!network_by_item_.count(id2)) { network_by_item_[id2] = {}; } network_by_item_[id1].insert({id1, id2}); network_by_item_[id2].insert({id1, id2}); } bool NetworkSet::IsItemInNetwork(int id) const { return network_by_item_.count(id); } const std::set>& NetworkSet::GetNetworkGraph(int id) const { return network_by_item_.at(id); } /lingo2-archipelago/'>lingo2-archipelago
Randomizer for LINGO 2 using Archipelago Multiworld
about summary refs log tree commit diff stats
path: root/tools/util/ids_yaml_format.h
blob: d926369bcc481dffc62d1f1561447e0ddf20192a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef TOOLS_UTIL_IDS_YAML_FORMAT_H_
#define TOOLS_UTIL_IDS_YAML_FORMAT_H_

#include <string>

#include "proto/human.pb.h"

namespace com::fourisland::lingo2_archipelago {

IdMappings ReadIdsFromYaml(const std::string& filename);

void WriteIdsAsYaml(const IdMappings& ids, const std::string& filename);

}  // namespace com::fourisland::lingo2_archipelago

#endif /* TOOLS_UTIL_IDS_YAML_FORMAT_H_ */