Files
cmr-mini/miniprogram/game/rules/rulePlugin.ts

12 lines
555 B
TypeScript

import { type GameDefinition } from '../core/gameDefinition'
import { type GameEvent } from '../core/gameEvent'
import { type GameResult } from '../core/gameResult'
import { type GameSessionState } from '../core/gameSessionState'
export interface RulePlugin {
readonly mode: GameDefinition['mode']
initialize(definition: GameDefinition): GameSessionState
buildPresentation(definition: GameDefinition, state: GameSessionState): GameResult['presentation']
reduce(definition: GameDefinition, state: GameSessionState, event: GameEvent): GameResult
}