15 std::string_view text) {
16 factions::Factions file;
17 const absl::Status parsed =
ParseText(text, file);
21 absl::StatusOr<std::map<uint32_t, factions::Faction>> by_id =
22 ById(file.factions());
24 return by_id.status();
28 std::set<uint32_t> heralds;
29 for (
const auto& [
id, faction] : *by_id) {
30 if (faction.color() == 0) {
31 return absl::InvalidArgumentError(
32 absl::StrCat(faction.name(),
" has no colour"));
34 if (faction.herald() == 0) {
35 return absl::InvalidArgumentError(
36 absl::StrCat(faction.name(),
" has no herald"));
38 if (!heralds.insert(faction.herald()).second) {
39 return absl::InvalidArgumentError(
40 absl::StrCat(
"two factions have the herald ", faction.herald()));