Implement Turn System
Closed this issue · 0 comments
StefanoFiumara commented
Implement a turn system that restricts players to only taking actions during their turn.
-
ChangeTurnAction
Should:- Contain which player's turn we are changing to (player ID)
-
Match
Should:- Track the ID of the player whose turn it currently is.
-
BeginGameAction
Should:- Contain which player takes the first turn of the game (player ID)
-
TurnSystem
Should:- Respond to
BeginGameAction
- Shuffle each player's deck (React with ShuffleDeckAction)
- Draw the starting hand for both players (React with DrawCardsAction)
- ChangeTurn to the starting player (React with ChangeTurnAction)
- Respond to a
ChangeTurnAction
- Update Match information to track current player index
- Respond to
-
HandSystem
Should:- Respond to a
ChangeTurnAction
- Draw a card for the next player's turn (React with
DrawCardsAction
)
- Respond to a
-
PlayerSystem
Should:- Respond to a
ChangeTurnAction
- Reset any card attributes that are per-turn abilities (
MoveableAttribute
)
- Reset any card attributes that are per-turn abilities (
- Respond to a
ShuffleDeckAction
- Shuffle the specified player's deck
- Respond to a
- Ensure all existing unit tests pass with these new systems in place
- Write new unit tests to verify functionality