rulePlugin.ts 555 B

1234567891011
  1. import { type GameDefinition } from '../core/gameDefinition'
  2. import { type GameEvent } from '../core/gameEvent'
  3. import { type GameResult } from '../core/gameResult'
  4. import { type GameSessionState } from '../core/gameSessionState'
  5. export interface RulePlugin {
  6. readonly mode: GameDefinition['mode']
  7. initialize(definition: GameDefinition): GameSessionState
  8. buildPresentation(definition: GameDefinition, state: GameSessionState): GameResult['presentation']
  9. reduce(definition: GameDefinition, state: GameSessionState, event: GameEvent): GameResult
  10. }