import type { Container } from 'pixi.js'

export interface PlayerDto {
  id: string
  name: string
  score: number
  hand: TileDto[]
  teamedWith: PlayerDto | null
  ready: boolean
}

export interface TileDto {
  id: string
  pips?: [number, number]
  orientation?: string
  x?: number
  y?: number
  width?: number
  height?: number
}
export interface MatchSessionState {
  id: string
  name: string
  creator: string
  players: PlayerDto[]
  seed: string
  waitingForPlayers: boolean
  mode: string
  pointsToWin: number
  sessionInProgress: boolean
  status: string
  maxPlayers: number
  numPlayers: number
  waitingSeconds: number
}

export interface GameState {
  id: string
  players: PlayerDto[]
  tilesInBoneyard: TileDto[]
  currentPlayer: PlayerDto | null
  tilesInBoard: TileDto[]
  gameInProgress: boolean
  winner?: any
  gameBlocked: boolean
  gameTied: boolean
  gameId: string
  tileSelectionPhase: boolean
  boardFreeEnds: number[]
  lastMove: Movement
  scoreboard: Map<string, number>
  matchWinner: PlayerDto | null
  matchInProgress: boolean
}

export interface Movement {
  id: string
  type: string
  tile?: TileDto
  playerId: string
  direction?: string
  x?: number
  y?: number
}

export interface ContainerOptions {
  width?: number
  height?: number
  x?: number
  y?: number
  color?: number
  visible?: boolean
  parent?: Container
}

export interface Dimension {
  width: number
  height: number
  x: number
  y: number
}
