nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
factions.h
Go to the documentation of this file.
1#ifndef NANOMMO_CONTENT_FACTIONS_H_
2#define NANOMMO_CONTENT_FACTIONS_H_
3
4#include <cstdint>
5#include <map>
6#include <string_view>
7
8#include "absl/status/statusor.h"
9#include "content/factions.pb.h"
10
11namespace nanommo {
12
13/// The factions in text format, by id, or what's wrong with them: a field
14/// factions.proto doesn't have, a faction with no id or with another's, one
15/// with no colour or no herald, or two with one herald.
16absl::StatusOr<std::map<uint32_t, factions::Faction>> ParseFactions(
17 std::string_view text);
18
19/// The faction a kind of NPC is the herald of, by the kind's id, or nullptr
20/// for one that's no herald.
21const factions::Faction* HeraldOf(
22 const std::map<uint32_t, factions::Faction>& factions, uint32_t kind);
23
24} // namespace nanommo
25
26#endif // NANOMMO_CONTENT_FACTIONS_H_
Definition chat.cc:9
const factions::Faction * HeraldOf(const std::map< uint32_t, factions::Faction > &factions, uint32_t kind)
Definition factions.cc:46
absl::StatusOr< std::map< uint32_t, factions::Faction > > ParseFactions(std::string_view text)
Definition factions.cc:14