Game

interface Game

A Game represents the state of a card game, including the players, cards, and the current state of the game. It provides methods to process events, apply actions, and compute values based on the current game state.

Properties

Link copied to clipboard
abstract val actionDeque: Deque<Action>

A Deque of Actions that are waiting to be processed.

Link copied to clipboard

The ActionProcessor used to process actions.

Link copied to clipboard

The EffectProcessor used to process effects.

Link copied to clipboard

The ValueResolver used to compute values.

Functions

Link copied to clipboard
open fun apply(action: Action)

Applies an Action to the game state.

Link copied to clipboard
open fun <T> computeValue(card: CardInstance, value: Value<T>): T?

Computes the value of a given Value for a specific CardInstance.

Link copied to clipboard
abstract fun getAllCards(): List<CardInstance>

Returns a List of all CardInstances in the game.

Link copied to clipboard
abstract fun getCurrentPlayer(): Player

Returns the current Player whose turn it is in the game.

Link copied to clipboard
abstract fun isGameOver(): Boolean

Checks if the game is over.

Link copied to clipboard
open fun publish(event: Event)

Publishes an Event to the game, triggering any relevant abilities and processing their effects.