From fe162025f1beaa52417f7714e433b485f7762117 Mon Sep 17 00:00:00 2001 From: DawnFire42 Date: Thu, 26 Feb 2026 18:27:32 -0500 Subject: [PATCH] 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. --- cockatrice/src/game/zones/zone_names.h | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 cockatrice/src/game/zones/zone_names.h diff --git a/cockatrice/src/game/zones/zone_names.h b/cockatrice/src/game/zones/zone_names.h new file mode 100644 index 000000000..53b85459c --- /dev/null +++ b/cockatrice/src/game/zones/zone_names.h @@ -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