GameRunningUseCase

scalata.application.usecases.GameRunningUseCase

Use-case that executes a full game turn:

==== Flow ====

  • Parse player command  →  run the matching player use-case.

  • On success  →  apply two enemy phases in order:

  • EnemyAttackUseCase

  • EnemyMovementUseCase

  • Error commands (quit / undo / help) return a corresponding GameError.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

final def execTurn[F[_] : Monad](gameSession: GameSession, command: F[PlayerCommand]): F[GameResult[GameSession]]

Execute a single turn:

Execute a single turn:

Type parameters

F

effect type with a cats.Monad instance (e.g. IO)

Value parameters

command

effect that yields a parsed PlayerCommand

gameSession

immutable snapshot before the turn starts

Attributes

Returns

a scalata.domain.util.GameResult containing the updated scalata.domain.world.GameSession or a domain error