1#ifndef NANOMMO_SERVER_COPIES_H_
2#define NANOMMO_SERVER_COPIES_H_
29 std::chrono::nanoseconds
empty{0};
47 void Leave(uint32_t
id);
55 void Step(std::chrono::nanoseconds time);
58 const std::map<uint32_t, Copy>&
all()
const {
return copies_; }
80 void SetWars(
const std::vector<War>& wars);
92 uint32_t For(
int land, uint32_t
id);
96 std::shared_ptr<const Content> content_;
98 std::vector<Terrain> terrains_;
100 std::vector<std::shared_ptr<Paths>> paths_;
101 std::map<uint32_t, Copy> copies_;
104 std::map<uint32_t, uint32_t> where_;
105 std::vector<War> wars_;
void SetWars(const std::vector< War > &wars)
int players() const
In all the copies.
const std::map< uint32_t, Copy > & all() const
By their ids.
Copies(uint32_t seed, Content content)
The world's seed makes each land's terrain, and the content fills them.
Copy * Of(uint32_t id)
The copy the player's in, or nullptr.
std::set< uint32_t > TakeTradeNews()
std::vector< Event > TakeEvents()
static constexpr std::chrono::minutes kEmptyLife
void Join(uint32_t id, Player player)
Into their land's copy: the open land's, or for a dungeon, their own.
std::set< uint32_t > TakeDuelNews()
const Content & content() const
What all of them are made of, which doesn't change as the game runs.
std::vector< Notice > TakeNotices()
The lines each copy has for its players since the last time.
std::vector< WarKill > TakeWarKills()
void Step(std::chrono::nanoseconds time)
std::optional< protocol::Input > Travel(Trip &trip, float x, float z)
std::map< Cell, std::vector< uint32_t > > Cells
The ids of what's in each cell.
A land, running: a World of it, with its NPCs in their cells.
std::chrono::nanoseconds empty
How long it's had nobody in it.
int land
By its place in kLands.