implemented basic turns + priority system#7
Open
ericsonoferik wants to merge 4 commits into
Open
Conversation
kenwuuu
reviewed
Nov 13, 2025
Owner
kenwuuu
left a comment
There was a problem hiding this comment.
Opt for less automation and more user choice. If something happens, it should usually be the user triggering something with known consequences. Also, try to have Claude work in smaller chunks. It vomits if you give it too much freedom and writes a lot of useless code, or just code that could be more concise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turn and Priority System
How It Works
Turn Structure: Only one player is active at a time. When a turn starts, the active player's tapped cards untap and they draw a card. Clicking "PASS THE TURN" moves to the next player clockwise.
Priority System: Inactive players can tap/untap cards, add counters, and move cards from battlefield to zones. They cannot move cards from dock to battlefield unless they click "TAKE PRIORITY". Priority allows playing cards while the active player remains active. Priority clears when the turn passes.
State: Turn state (active player, player order, priority) is stored in Yjs and syncs across all peers.
File Changes
New Files:
src/services/turnManager/TurnManager.ts- Core turn and priority management logicsrc/services/turnManager/index.ts- Export filesrc/components/TurnSystem.tsx- React UI component for turn controlssrc/components/TurnSystem.module.css- Styles for turn system UIsrc/vite-env.d.ts- TypeScript declarations for CSS modulesModified Files:
src/index.ts- Integrated TurnManager, added turn state observer and event handlerssrc/services/eventHandlers/WhiteboardEventHandlers.ts- Added turn/priority checks for card playsrc/modules/whiteboard/KeyboardHandler.ts- Removed ownership restrictions for battlefield interactionssrc/modules/gameResourcesDock/GameResourcesDock.ts- Added playCard event dispatch for keyboard shortcutsRecent Changes
Refactored all inline styles to
TurnSystem.module.cssCSS module for better maintainability and consistency with other components.