nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
graph.h
Go to the documentation of this file.
1#ifndef NANOMMO_CONTENT_GRAPH_H_
2#define NANOMMO_CONTENT_GRAPH_H_
3
4#include <string>
5#include <vector>
6
7#include "absl/status/status.h"
8#include "absl/status/statusor.h"
9#include "content/content.h"
10#include "smollergraph/graph.h"
11
12namespace nanommo {
13
14/// The node each path starts from: someone who's just made a character, with
15/// the land, the kit and the skills a new player gets.
16inline constexpr char kNewPlayer[] = "A new player";
17
18/// Adds the content to a graph in smollerGraph: a node for each land, kind of
19/// monster, kind of NPC, quest, item, skill and faction, labelled with what it
20/// is, and a relationship for each way a player gets from one to the next,
21/// from a new player to their land, through its gates, to who's in each land,
22/// and on to what they drop, give and teach, and the factions their heralds
23/// swear players to. Each recipe is a node too, which what goes into it goes
24/// INTO, and which leads to what it makes, and a new player CRAFTS it once they
25/// reach all it takes. A quest also asks for its monster, which is what it
26/// takes to finish it, not a way to get anywhere. Or says why it can't: two
27/// things with one name, which would be one node, a name too long for a node,
28/// or a query's error.
29absl::Status AddContentGraph(const Content& content,
30 smollergraph::Graph& graph);
31
32/// What's wrong with the content as a graph, a line each: what no path from a
33/// new player reaches, such as "Leather Cap, an item", and each quest whose
34/// monster is out of reach, which nobody can finish. Or the query's error.
35absl::StatusOr<std::vector<std::string>> Unreachable(
36 const smollergraph::Graph& graph);
37
38/// Each item that goes back into itself through recipes, a line each, with the
39/// way round, such as "Bone goes back into itself: (Bone)-[:INTO]->...". A
40/// recipe that makes more of an item than went into it, round and round, makes
41/// it from nothing. Or the query's error.
42absl::StatusOr<std::vector<std::string>> Cycles(
43 const smollergraph::Graph& graph);
44
45} // namespace nanommo
46
47#endif // NANOMMO_CONTENT_GRAPH_H_
Definition chat.cc:9
absl::StatusOr< std::vector< std::string > > Cycles(const smollergraph::Graph &graph)
Definition graph.cc:293
absl::Status AddContentGraph(const Content &content, smollergraph::Graph &graph)
Definition graph.cc:142
absl::StatusOr< std::vector< std::string > > Unreachable(const smollergraph::Graph &graph)
Definition graph.cc:257
constexpr char kNewPlayer[]
Definition graph.h:16