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

#include <hotbar.h>

Public Member Functions

 Hotbar (const SkillTable &skills)
std::optional< uint32_t > Build (const std::vector< Figure > &figures, const protocol::World &world, uint32_t target, uint32_t target_player=0)
std::vector< uint32_t > Order () const
 The skills after the swing, by their ids, in their slots' order.
void Arrange (const std::vector< uint32_t > &order)
bool TakeRearranged ()
 Whether the player has swapped two skills since this was last asked.

Static Public Attributes

static constexpr int kRow = 9
 A row's worth of number keys.
static constexpr int kMostSlots = 2 * kRow

Detailed Description

The skills along the bottom of the screen: the swing first, on Space, then the others, each on a number key: 1 for the first, and so on, up to nine, and then a row above it, on the same keys with Shift. They start in the order of their levels, and the player drags one onto another to swap them.

Definition at line 19 of file hotbar.h.

Constructor & Destructor Documentation

◆ Hotbar()

nanommo::Hotbar::Hotbar ( const SkillTable & skills)
explicit

Definition at line 96 of file hotbar.cc.

Member Function Documentation

◆ Arrange()

void nanommo::Hotbar::Arrange ( const std::vector< uint32_t > & order)

Puts the skills in the order, as the player left them: the ones it names first, in its order, and any it doesn't after them, as they were.

Definition at line 126 of file hotbar.cc.

◆ Build()

std::optional< uint32_t > nanommo::Hotbar::Build ( const std::vector< Figure > & figures,
const protocol::World & world,
uint32_t target,
uint32_t target_player = 0 )

Draws each skill with its icon and its key, and how long until it's ready, or, while the player doesn't know it, the level it needs, or Learn once they've reached it. A skill that hits one monster is red while they've picked none, by its id in target, or the player in target_player, an opponent in a duel or an enemy at war, as the server runs them up to the one they picked, however far. Returns the skill the player used, with its key or a click.

Definition at line 141 of file hotbar.cc.

◆ Order()

std::vector< uint32_t > nanommo::Hotbar::Order ( ) const

The skills after the swing, by their ids, in their slots' order.

Definition at line 118 of file hotbar.cc.

◆ TakeRearranged()

bool nanommo::Hotbar::TakeRearranged ( )

Whether the player has swapped two skills since this was last asked.

Definition at line 139 of file hotbar.cc.

Member Data Documentation

◆ kMostSlots

int nanommo::Hotbar::kMostSlots = 2 * kRow
staticconstexpr

Definition at line 23 of file hotbar.h.

◆ kRow

int nanommo::Hotbar::kRow = 9
staticconstexpr

A row's worth of number keys.

Definition at line 22 of file hotbar.h.


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