* [Game][Player] Pull out graphics_items out of player_logic
Took 25 seconds
Took 9 minutes
* [Game] Move graphics files into game_graphics
Took 1 minute
Took 2 minutes
Took 23 seconds
Took 1 minute
Took 2 seconds
* Include.
Took 4 minutes
Took 3 minutes
Took 4 minutes
Took 1 minute
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem
Took 4 minutes
Took 48 seconds
Took 2 minutes
* Drop early return.
Took 1 hour 13 minutes
Took 2 minutes
Took 1 minute
Took 24 seconds
* [Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem
Took 4 minutes
Took 58 seconds
* [Game][Menus] Make Menus accept PlayerGraphicsItem instead of PlayerLogic
Took 7 minutes
Took 4 minutes
Took 9 seconds
Took 2 minutes
Took 5 minutes
Took 58 seconds
* [Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem
Took 4 minutes
Took 2 minutes
* [Game][Menus] Make Menus accept PlayerGraphicsItem instead of PlayerLogic
Took 7 minutes
Took 1 minute
Took 57 seconds
* [Game][Player] Move dialog creation out of player_actions and into player_dialogs
Took 3 minutes
Took 1 second
* Fix typo.
Took 5 minutes
* Addressed comments.
Took 16 minutes
Took 11 seconds
* Reintroduce clearCardsToDelete check.
Took 3 minutes
* Capture cards before semaphore.
Took 1 minute
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem
Took 4 minutes
Took 58 seconds
Took 2 minutes
* [Game][Menus] Make Menus accept PlayerGraphicsItem instead of PlayerLogic
Took 7 minutes
Took 4 minutes
Took 9 seconds
Took 2 minutes
Took 5 minutes
Took 58 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Game][Player] Split Player into PlayerLogic/PlayerGraphicsItem
Took 4 minutes
Took 48 seconds
* Drop early return.
Took 1 hour 13 minutes
Took 2 minutes
Took 1 minute
* Delete player view.
Took 37 seconds
* Restore card counter color in menu.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Game] [Arrows] Track creatorId, use arrowData in arrowItem, use registry, generate unique arrow id's on server side and delete-on-exist inserts.
Took 2 minutes
Took 1 minute
* Fix emitting slot instead of signal.
Took 15 minutes
* Clear arrows locally in special circumstances i.e. teardown.
Took 28 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Implements a start to the keyboard navigation with the direction arrows
and the space key for card selection.
Some binds are still needed, but navigating the board is now possible.
The feature includes tests for the implemented feature.
Closes#5043
Co-authored-by: Manuel Ramos Monge <manuel.monge@tecnico.ulisboa.pt>
* [Game][Arrows] Deleting arrows has no acknowledgement command so we have to delete locally as well.
Took 22 minutes
* Fix properly.
Took 15 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor server counter API to own overflow protection and filter no-op events
Counter modifications now clamp to int bounds server-side and return change
status, allowing command handlers to skip network broadcasts when values
don't actually change.
* Centralize MAX_COUNTERS_ON_CARD and enforce [0, 999] bounds on server
- Move MAX_COUNTERS_ON_CARD to trice_limits.h
- Server clamps values in setCounter() and incrementCounter()
- Client uses clamped comparison to allow recovery from invalid states
- Add tests for clamping behavior
* move incrementCount() implementation from header to cpp
* [Game][Arrows] Split Arrows into ArrowData and ArrowItem
Took 13 minutes
Took 5 seconds
Took 1 minute
Took 26 seconds
* Address comments.
Took 17 minutes
Took 9 seconds
Took 1 minute
* Change check.
Took 3 minutes
* Pass by const reference.
Took 10 minutes
* Remove extra method
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Counters] Split counters into graphics and logic states
Took 22 minutes
* Don't have widget hold pointer to state -> Copy what we need and subscribe to changes.
Took 12 minutes
Took 5 seconds
* Sync value too.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Player] Stop reaching into graphics_item and emit signals instead for conceded and zoneId
Took 7 minutes
Took 3 seconds
* Add sameValue check.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Game/Zones] Simple move refactor to differentiate between logic and graphics for zones
Took 21 minutes
* Clean up game/zones/logic folder.
Took 6 minutes
* Adjust tests.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* style: Add braces to all control flow statements
Standardize code style by adding explicit braces to all single-statement
control flow blocks (if, else, for, while) across the entire codebase.
Also documents the InsertBraces clang-format option (requires v15+) for
future automated enforcement.
* InsertBraces-check-enabled
* feat: enable expressions in card counters
* fix includes
* fix multiple selection
* cleanup useless conversions
* const ref where possible
* do not use const, be consistent with local patterns in the file
Reorganize card context menus across table, stack, and graveyard/exile zones for better consistency: promote Draw Arrow and Clone actions, move related card entries to the bottom, add Play/Play Face Down to the stack menu, and flatten if/else blocks with early returns. Also fix playCard() ignoring the faceDown flag when routing instants/sorceries from the stack, which sent them to the graveyard instead of the table.
Adds a Table option to the Move menu, allowing cards to be moved directly to the battlefield from any zone. Extracts the repeated tableRow-to-grid-Y conversion logic into TableZone::tableRowToGridY(), consolidating five call sites and fixing a latent bug where cards with tableRow > 2 could land on the wrong row.
Non-QObject polymorphic interface with setShortcutsActive(), setShortcutsInactive(), and retranslateUi(). Uses regular multiple inheritance to avoid diamond inheritance with Qt's MOC.
All zone menus, SayMenu, and AbstractCounter implement this interface. PlayerMenu manages them via a managedComponents list with two template helpers (addManagedMenu/registerManagedComponent), replacing individual if-guarded lifecycle calls with a single polymorphic loop.
SayMenu now owns its shortcut and translation lifecycle instead of having PlayerMenu manage its title and shortcuts externally.
Counters are iterated via Player::getCounters() rather than managedComponents to avoid duplicating the authoritative owner's map.
* 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.
* refactor(server): use ZoneNames constants in server game logic
Replace hardcoded zone name strings with ZoneNames:: constants in:
- server_player.cpp: zone setup, draw, shuffle, mulligan operations
- server_abstract_player.cpp: card movement and token destruction
- server_game.cpp: returning cards when players leave
No functional changes - purely mechanical string literal replacement.
* refactor(client): use ZoneNames constants in core player/zone logic
Update the foundational player and zone classes to use ZoneNames::
constants instead of string literals. Changes include:
- player.h/cpp: zone initialization and builtinZones set
- card_zone_logic.cpp: zone name translation for UI display
- table_zone.cpp: table zone operations
No functional changes - purely mechanical string literal replacement.
* refactor(client): use ZoneNames constants in player actions and events
Replace zone name strings with ZoneNames:: constants in the player
action and event handling code. player_actions.cpp contains the most
extensive changes (~90+ replacements) covering all card movement
commands.
No functional changes - purely mechanical string literal replacement.
* refactor(client): use ZoneNames constants in zone menu handlers
Update all zone-specific menu files to use ZoneNames:: constants
for QAction data values and zone targeting. This covers context menus
for cards, graveyard, hand, and exile (RFG) zones.
No functional changes - purely mechanical string literal replacement.
* refactor(client): use ZoneNames constants in game scene components
Update remaining game scene components to use ZoneNames:: constants:
- arrow_item.cpp: arrow drawing between cards
- game_scene.cpp: zone view positioning
- message_log_widget.cpp: removes duplicate local static constants
that were previously defining zone names redundantly
- phases_toolbar.cpp: phase actions (untap all)
Notable: message_log_widget.cpp previously had its own local constants
(TABLE_ZONE_NAME, GRAVE_ZONE_NAME, etc.) which are now removed in favor
of the centralized ZoneNames:: constants.
* formatting fix
* refactor: extract CARD_HEIGHT to shared CardDimensions header
Move duplicated CARD_WIDTH/CARD_HEIGHT constants to card_dimensions.h.
Fixed documentation in z_value_layer_manager.h.
* WIDTH_F used directly instead of casting
* Improved consistency and added missing newlines at end of files
* remove helpers
* create getZoneNodes method
* replace direct calls to getRoot and forEachCard
* remove more non-const uses of forEachCard
* make node getter return const lists
* one more usage
* address comment
* address comment again
* fix hash
* fix hashes (for real this time)
* [Cleanup] Unused #includes
Took 44 minutes
* [Cleanup] More unused #includes
Took 55 minutes
* [Cleanup] Include QSet
Took 4 minutes
* [Cleanup] Include QDebug in deck_list.cpp
Took 3 minutes
* [Cleanup] Include protocol stuff in servatrice_database_interface.h
Took 3 minutes
* [Cleanup] Include QDialogButtonBox
Took 8 minutes
* [Cleanup] Include QUrl
Took 8 minutes
* [Cleanup] Include QTextOption in header.
Took 3 minutes
* [Cleanup] Include QMap in user_list_manager.h
Took 8 minutes
* [Cleanup] Adjust qjson
Took 8 minutes
* [Cleanup] include button box.
Took 3 minutes
* [Cleanup] Redo fwd declarations.
* [Cleanup] Redo last removed fwd declarations.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [DeckList] Disable copy constructor
Took 1 hour 44 minutes
Took 1 minute
# Commit time for manual adjustment:
# Took 28 seconds
Took 33 seconds
* Revert member to pointer.
Took 19 minutes
* Revert pulling up setters/getters now that getDeckList is no longer const.
Took 6 minutes
* Revert more.
Took 2 minutes
* One more fix.
Took 1 minute
* Update cockatrice/src/interface/deck_loader/deck_loader.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* [Refactor] Move AbstractGraphicsItem and GraphicsItemType to game_graphics/board folder.
Took 3 minutes
* Update CMakeLists.txt
Took 12 minutes
* Update CMakeLists.txt
Took 12 minutes
Took 2 minutes
Took 16 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>