GameRunner

com.phasmidsoftware.gambit.game.GameRunner
class GameRunner[P, S, M, Pl](playerMap: Map[Pl, Player[S, M, Pl]], random: Random = ...)(using state: State[P, S], game: Game[S, M, Pl])

A generic game runner that plays a sequence of games between any number of players, for any game representable as a State[P, S] and Game[S, M, Pl].

Type parameters: P — proto-state type (used by State.construct) S — state type M — move type Pl — player identity type (e.g., Boolean for two-player, Seat for bridge)

Value parameters

game

implicit Game[S, M, Pl] for game mechanics.

playerMap

a map from player identity to Player instance.

random

a Random instance for reproducibility.

state

implicit State[P, S] for goal detection.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def playGame(): GameResult[Pl]

Play a single game from the starting state.

Play a single game from the starting state.

Attributes

Returns

a GameResult mapping each player to their score.

def playGames(n: Int): MatchResult[Pl]

Play n games and return aggregated statistics.

Play n games and return aggregated statistics.

Value parameters

n

the number of games to play.

Attributes

Returns

a MatchResult summarising all games.