Category talk

Shuffle

From Shadow Era Wiki

Revision as of 19:12, 2 October 2024 by Blopi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Code Summary and Detailed Code

FILE REFERENCES IN THE GAME
TERMS TO LOCATE SEEK 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 SEEK 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. `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.
DETAILED CODE