|
group2 0.1.0
CSE 125 Group 2
|
Curated animal-handle list used as default player nicknames. More...
#include <array>Go to the source code of this file.
Namespaces | |
| namespace | player_nicknames |
Variables | |
| constexpr std::array< const char *, 24 > | player_nicknames::k_nicknames |
| constexpr int | player_nicknames::k_nicknameCount = static_cast<int>(k_nicknames.size()) |
Curated animal-handle list used as default player nicknames.
On connect, ServerGame picks the least-used slot from this array (ties broken by lowest index for deterministic assignment across reconnects) and writes the matching string into the new player's PlayerName component. Mirrors player_colors::k_palette's pattern exactly — keeping the two systems parallel makes "what handle do I get?" follow the same mental model as "what tint do I get?".
Adding a new nickname is drop-in: extend the array. Removing one mid- match is also fine; in-flight players keep their assigned name (it's stored in their replicated component, not by index).
All-caps to match the Voidfall mil-spec aesthetic.