scalata.infrastructure.controller
Members list
Type members
Classlikes
class ChampSelectController[F[_]](askClass: F[PlayerClasses])(implicit evidence$1: Sync[F]) extends Controller[F]
Controller for the champion-selection screen.
Controller for the champion-selection screen.
- Delegates to ChampSelectUseCase to obtain the player’s chosen class.
- Propagates the resulting
(nextPhase, GameBuilder)pair.
Value parameters
- askClass
-
effect that yields the selected PlayerClasses
Attributes
- Supertypes
Base controller interface.
Base controller interface.
- start – executes one screen / state step and returns a
GameResultcarrying the next(GameControllerState, GameBuilder).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class ChampSelectController[F]class GameController[F]class GameOverController[F]class MenuController[F]
class GameController[F[_]](askCommand: GameSession => F[PlayerCommand])(implicit evidence$1: Sync[F]) extends Controller[F]
Controller that manages the Game-Running state.
Controller that manages the Game-Running state.
- Builds an initial GameSession from the supplied GameBuilder.
- Runs the main turn loop by delegating to GameRunningUseCase.
- Handles
Success/Erroroutcomes and decides the next GameControllerState.
Type parameters
- F
-
effect type, usually
IO
Value parameters
- askCommand
-
side-effecting function that retrieves a PlayerCommand from the active view.
Attributes
- Supertypes
Orchestrates high-level state transitions of the game.
Orchestrates high-level state transitions of the game.
- Picks the controller that matches the current
GameControllerState. - Delegates one step to that controller.
- Reads the returned
GameResultand, if successful, recurses with the next phase and updatedGameBuilder. - Ends with
ExitCode.Successwhen any controller returns an error (e.g. player quit).
Type parameters
- F
-
effect type (usually
IO)
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
class GameOverController[F[_]](askRestart: F[Boolean])(implicit evidence$1: Sync[F]) extends Controller[F]
Controller for the GameOver screen.
Controller for the GameOver screen.
- Invokes GameOverUseCase to ask the player whether to restart.
- Returns either
(GameControllerState.Menu, newBuilder)when the player chooses to restart, or propagates the quit signal.
Value parameters
- askRestart
-
side-effecting Boolean (true=restart, false=quit)
Attributes
- Supertypes
class MenuController[F[_]](askStart: F[Boolean])(implicit evidence$1: Sync[F]) extends Controller[F]
Controller for the main menu.
Controller for the main menu.
- Calls GameStartUseCase to ask the player if a new run should begin.
- Returns the next GameControllerState together with the updated GameBuilder.
Value parameters
- askStart
-
effect that yields true to start or false to quit
Attributes
- Supertypes
In this article