mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-07 05:53:59 -07:00
refactor(zones): introduce ZoneNames constants header
Add a centralized header for zone name string constants used in protocol messages and zone lookups. This replaces scattered hardcoded string literals with type-safe constants, improving maintainability and reducing typo risks. The ZoneNames namespace provides constants for core game zones: table, grave, exile (rfg), hand, deck, sideboard, and stack.
This commit is contained in:
parent
bdb42bbbbd
commit
fe162025f1
1 changed files with 28 additions and 0 deletions
28
cockatrice/src/game/zones/zone_names.h
Normal file
28
cockatrice/src/game/zones/zone_names.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* @file zone_names.h
|
||||
* @ingroup GameLogicZones
|
||||
* @brief Canonical string identifiers for game zones.
|
||||
*/
|
||||
|
||||
#ifndef ZONE_NAMES_H
|
||||
#define ZONE_NAMES_H
|
||||
|
||||
/**
|
||||
* @namespace ZoneNames
|
||||
* @brief String constants for zone identification in protocol and lookups.
|
||||
*
|
||||
* These constants define the canonical names used to identify zones
|
||||
* in network protocol messages and zone lookup operations.
|
||||
*/
|
||||
namespace ZoneNames
|
||||
{
|
||||
constexpr const char *TABLE = "table";
|
||||
constexpr const char *GRAVE = "grave";
|
||||
constexpr const char *EXILE = "rfg";
|
||||
constexpr const char *HAND = "hand";
|
||||
constexpr const char *DECK = "deck";
|
||||
constexpr const char *SIDEBOARD = "sb";
|
||||
constexpr const char *STACK = "stack";
|
||||
} // namespace ZoneNames
|
||||
|
||||
#endif // ZONE_NAMES_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue