|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
#include <duels.h>
Classes | |
| struct | Duel |
Public Types | |
| enum class | State { kAsked , kCountdown , kFighting } |
Public Member Functions | |
| void | Ask (uint32_t id, uint32_t other) |
| The player asks the other to duel. Neither may be in a duel already. | |
| uint32_t | Accept (uint32_t id, Place flag) |
| const Duel * | Of (uint32_t id) const |
| The player's duel, from the ask to the end, or nullptr. | |
| uint32_t | Opponent (uint32_t id) const |
| Who the player's duelling, by their id, once the countdown's over, or 0. | |
| uint32_t | End (uint32_t id) |
| std::vector< Duel > | Step (std::chrono::nanoseconds time) |
| const std::map< uint32_t, Duel > & | all () const |
| Each duel, by its challenger's id. | |
| std::set< uint32_t > | TakeNews () |
Static Public Attributes | |
| static constexpr float | kReach = 10.0f |
| A player asks another within this many metres of them. | |
| static constexpr std::chrono::seconds | kAskTime {30} |
| An ask waits this long for a yes. | |
| static constexpr std::chrono::seconds | kCountdown {3} |
| From the yes to the duel, so that both sides are ready for it. | |
| static constexpr float | kFlagReach = 25.0f |
The duels between the players in one copy of a land, which its World keeps, as it does their trades, so that both players are always in it. A player asks another to duel, and once the other says yes, a countdown starts, and then the duel. A player is in one duel at a time, from the ask to the end.
|
strong |
| uint32_t nanommo::Duels::Accept | ( | uint32_t | id, |
| Place | flag ) |
|
inline |
| void nanommo::Duels::Ask | ( | uint32_t | id, |
| uint32_t | other ) |
| uint32_t nanommo::Duels::End | ( | uint32_t | id | ) |
| const Duels::Duel * nanommo::Duels::Of | ( | uint32_t | id | ) | const |
| uint32_t nanommo::Duels::Opponent | ( | uint32_t | id | ) | const |
| std::vector< Duels::Duel > nanommo::Duels::Step | ( | std::chrono::nanoseconds | time | ) |
| std::set< uint32_t > nanommo::Duels::TakeNews | ( | ) |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |