nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::Copies Class Reference

#include <copies.h>

Public Member Functions

 Copies (uint32_t seed, Content content)
 The world's seed makes each land's terrain, and the content fills them.
void Join (uint32_t id, Player player)
 Into their land's copy: the open land's, or for a dungeon, their own.
void Leave (uint32_t id)
Copy * Of (uint32_t id)
 The copy the player's in, or nullptr.
void Step (std::chrono::nanoseconds time)
const std::map< uint32_t, Copy > & all () const
 By their ids.
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< Event > TakeEvents ()
std::set< uint32_t > TakeTradeNews ()
std::set< uint32_t > TakeDuelNews ()
void SetWars (const std::vector< War > &wars)
std::vector< WarKill > TakeWarKills ()
int players () const
 In all the copies.

Static Public Attributes

static constexpr std::chrono::minutes kEmptyLife {5}

Detailed Description

The world's lands, as copies. Each open land has one from the start, and a dungeon has one for each player who goes in, from when they do.

Definition at line 34 of file copies.h.

Constructor & Destructor Documentation

◆ Copies()

nanommo::Copies::Copies ( uint32_t seed,
Content content )

The world's seed makes each land's terrain, and the content fills them.

Definition at line 20 of file copies.cc.

Member Function Documentation

◆ all()

const std::map< uint32_t, Copy > & nanommo::Copies::all ( ) const
inline

By their ids.

Definition at line 58 of file copies.h.

◆ content()

const Content & nanommo::Copies::content ( ) const
inline

What all of them are made of, which doesn't change as the game runs.

Definition at line 61 of file copies.h.

◆ Join()

void nanommo::Copies::Join ( uint32_t id,
Player player )

Into their land's copy: the open land's, or for a dungeon, their own.

Definition at line 33 of file copies.cc.

◆ Leave()

void nanommo::Copies::Leave ( uint32_t id)

Definition at line 39 of file copies.cc.

◆ Of()

Copy * nanommo::Copies::Of ( uint32_t id)

The copy the player's in, or nullptr.

Definition at line 48 of file copies.cc.

◆ players()

int nanommo::Copies::players ( ) const

In all the copies.

Definition at line 103 of file copies.cc.

◆ SetWars()

void nanommo::Copies::SetWars ( const std::vector< War > & wars)

The wars between the world's guilds, for each of them, and each made after.

Definition at line 88 of file copies.cc.

◆ Step()

void nanommo::Copies::Step ( std::chrono::nanoseconds time)

Steps the copies with players in them, and the open lands' always, takes players through the gates, and drops the dungeons' copies that have been empty for kEmptyLife.

Definition at line 111 of file copies.cc.

◆ TakeDuelNews()

std::set< uint32_t > nanommo::Copies::TakeDuelNews ( )

The players whose duel, in any of them, has been asked for, counted down, started or ended since the last time.

Definition at line 80 of file copies.cc.

◆ TakeEvents()

std::vector< Event > nanommo::Copies::TakeEvents ( )

What's happened in all of them since the last time, each with the copy it happened in.

Definition at line 61 of file copies.cc.

◆ TakeNotices()

std::vector< Notice > nanommo::Copies::TakeNotices ( )

The lines each copy has for its players since the last time.

Definition at line 53 of file copies.cc.

◆ TakeTradeNews()

std::set< uint32_t > nanommo::Copies::TakeTradeNews ( )

The players whose trade, in any of them, has opened, changed or ended since the last time.

Definition at line 72 of file copies.cc.

◆ TakeWarKills()

std::vector< WarKill > nanommo::Copies::TakeWarKills ( )

The players killed by an enemy at war, in any of them, since the last time.

Definition at line 95 of file copies.cc.

Member Data Documentation

◆ kEmptyLife

std::chrono::minutes nanommo::Copies::kEmptyLife {5}
staticconstexpr

After its last player leaves, a dungeon's copy stops, and waits this long for them before it goes, so that someone who steps out finds it as they left it.

Definition at line 39 of file copies.h.


The documentation for this class was generated from the following files: