Category talk

Difference between revisions of "Shuffle"

From Shadow Era Wiki

(Page created)
 
m
Line 3: Line 3:
 
{| class="wikitable" code-table"
 
{| class="wikitable" code-table"
 
|-
 
|-
! <center>FILE REFERENCES IN THE GAME</center> || <center>TERMS TO LOCATE SEEK REFERENCE</center>
+
! <center>FILE REFERENCES IN THE GAME</center> || <center>TERMS TO LOCATE SHUFFLE REFERENCE</center>
 
|-
 
|-
 
| style="vertical-align: top;" |
 
| style="vertical-align: top;" |
Line 17: Line 17:
 
* ShuffleDeck
 
* ShuffleDeck
 
|-
 
|-
! colspan="2" | <center>SUMMARY OF THE SEEK PROCESS:</center>
+
! colspan="2" | <center>SUMMARY OF THE SHUFFLE PROCESS:</center>
 
|-
 
|-
 
| colspan="2" |
 
| colspan="2" |
# `ShuffleDeck(int side)` : Handles the shuffling of the deck for the specified player side.
+
# `ShuffleDeck(int side)` :<br>Handles the shuffling of the deck for the specified player side.<br>
# `ShuffleDeck()` : Calls the shuffle method for the current player side.
+
# `ShuffleDeck()` :<br>Calls the shuffle method for the current player side.<br>
# `shuffledDeckThisTurn[side]++` : Increments the shuffle counter for the current turn for the specified player side.
+
# `gameData.shuffledDeckThisTurn[side]++` :<br>Increments the shuffle counter for the current turn for the specified player side.<br>
# `GameModel.ShuffleDeck()` : Called in the game controller to trigger the shuffle process.
+
# `GameModel.ShuffleDeck()` :<br>Called in the game controller to trigger the shuffle process.<br>
# `GameModel.GameStateActivate(GameState.GameStateType.mulliganDraw)` : Changes the game state to allow for a mulligan, influencing when the shuffle occurs.
+
# `GameModel.GameStateActivate(GameState.GameStateType.mulliganDraw)` :<br>Changes the game state to allow for a mulligan, influencing when the shuffle occurs.<br>
# `GameModel.ShuffleDeck(1)` : Executes the shuffle for player 1, ensuring that their deck is mixed before drawing.
+
# `GameModel.ShuffleDeck(1)` :<br>Executes the shuffle for player 1, ensuring that their deck is mixed before drawing.<br>
 +
# `case GameStateType.draw:` :<br>Logic for handling the draw state, ensuring that the game responds appropriately after a shuffle.<br>
 +
# `case GameStateType.mulliganDraw:` :<br>Logic for handling the mulligan draw state, ensuring that the shuffle occurs correctly.<br>
 
|-
 
|-
 
! colspan="2" | <center>DETAILED CODE</center>
 
! colspan="2" | <center>DETAILED CODE</center>

Revision as of 19:21, 2 October 2024


Code Summary and Detailed Code

FILE REFERENCES IN THE GAME
TERMS TO LOCATE SHUFFLE REFERENCE
  • GameModel.cs: Contains the main logic for managing the deck and card operations, including shuffling:
    `public static void ShuffleDeck(int side)`, `public static void ShuffleDeck()`, `gameData.shuffledDeckThisTurn[side]++`.

  • GameController.cs: Handles game events and triggers deck shuffling and state changes:
    `GameModel.ShuffleDeck()`, `GameModel.GameStateActivate(GameState.GameStateType.mulliganDraw)`.

  • Gameplay.cs: Manages the flow of the game, including player interactions and calling shuffle methods:
    `GameModel.ShuffleDeck(1)`.

  • GameController.cs: Defines game states and manages the logic for drawing and shuffling based on state transitions:
    `case GameStateType.draw:`, `case GameStateType.mulliganDraw:`.

  • Shuffle
  • Deck
  • Randomness
  • GameState
  • ShuffleDeck
SUMMARY OF THE SHUFFLE PROCESS:
  1. `ShuffleDeck(int side)` :
    Handles the shuffling of the deck for the specified player side.
  2. `ShuffleDeck()` :
    Calls the shuffle method for the current player side.
  3. `gameData.shuffledDeckThisTurn[side]++` :
    Increments the shuffle counter for the current turn for the specified player side.
  4. `GameModel.ShuffleDeck()` :
    Called in the game controller to trigger the shuffle process.
  5. `GameModel.GameStateActivate(GameState.GameStateType.mulliganDraw)` :
    Changes the game state to allow for a mulligan, influencing when the shuffle occurs.
  6. `GameModel.ShuffleDeck(1)` :
    Executes the shuffle for player 1, ensuring that their deck is mixed before drawing.
  7. `case GameStateType.draw:` :
    Logic for handling the draw state, ensuring that the game responds appropriately after a shuffle.
  8. `case GameStateType.mulliganDraw:` :
    Logic for handling the mulligan draw state, ensuring that the shuffle occurs correctly.
DETAILED CODE