mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-07 05:53:59 -07:00
Add ZoneNames constants for protocol zone identifiers. Introduce a centralized ZoneNames namespace providing constexpr constants for zone identifiers used in the client-server protocol. This establishes a single source of truth for zone names like TABLE, GRAVE, EXILE, HAND, DECK, SIDEBOARD, and STACK. The protocol values remain unchanged (e.g., EXILE maps to rfg for backwards compatibility) while providing meaningful constant names.
This commit is contained in:
parent
42cec10457
commit
1464973935
2 changed files with 20 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ set(UTILITY_SOURCES libcockatrice/utility/expression.cpp libcockatrice/utility/l
|
|||
set(UTILITY_HEADERS
|
||||
libcockatrice/utility/color.h libcockatrice/utility/expression.h libcockatrice/utility/levenshtein.h
|
||||
libcockatrice/utility/macros.h libcockatrice/utility/passwordhasher.h libcockatrice/utility/trice_limits.h
|
||||
libcockatrice/utility/zone_names.h
|
||||
)
|
||||
|
||||
add_library(libcockatrice_utility STATIC ${UTILITY_SOURCES} ${UTILITY_HEADERS})
|
||||
|
|
|
|||
19
libcockatrice_utility/libcockatrice/utility/zone_names.h
Normal file
19
libcockatrice_utility/libcockatrice/utility/zone_names.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef ZONE_NAMES_H
|
||||
#define ZONE_NAMES_H
|
||||
|
||||
namespace ZoneNames
|
||||
{
|
||||
// Protocol-level zone identifiers shared between client and server.
|
||||
// These must match exactly across all components.
|
||||
|
||||
constexpr const char *TABLE = "table";
|
||||
constexpr const char *GRAVE = "grave";
|
||||
constexpr const char *EXILE = "rfg"; // "removed from game"
|
||||
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