import {IBitmapTextStyle} from "pixi.js";

/**
 * @interface SymbolConfig
 * @description Configuration for an individual symbol in the slot machine.
 */
export interface SymbolConfig {
  /**
   * @property {string} key - The key of the symbol.
   */
  key: string
  /**
   * @property {string} spine - The category of the symbol, defining its sprite.
   */
  spine: string;

  /**
   * @property {string} skin - The appearance or skin of the symbol.
   */
  skin: string;

  /**
   * @property {"COMMON" | "BONUS" | "MULTIPLIER"} type - The type of the symbol (common, bonus, or multiplier).
   */
  type: "COMMON" | "BONUS" | "MULTIPLIER";

  /**
   * @property {number} value - The value of the symbol.
   */
  value: number;

  /**
   * @property {IBitmapTextStyle} fontStyle - The style of the font for the symbol.
   */
  fontStyle?: IBitmapTextStyle,

  /**
   * @property {number} zIndex - The z-index of the symbol.
   */
  zIndex?: number
}

/**
 * @interface SlotMachineConfig
 * @description Main configuration for the slot machine.
 */
export interface SlotMachineConfig {
  /**
   * @property {number} width - The width of the game area.
   */
  width: number;

  /**
   * @property {number} height - The height of the game area.
   */
  height: number;

  /**
   * @property {number} reels - The number of reels in the slot machine.
   */
  reels: number;

  /**
   * @property {number} slots - The number of slots on each reel.
   */
  slots: number;

  /**
   * @property {string[]} symbolsKeys - The keys for all available symbols.
   */
  symbolsKeys: string[];

  /**
   * @property {Record<string, number>} [symbolsWeights] - Optional weights for random symbol selection during reel spinning.
   * Keys are symbol keys, values are non-negative weights. A weight of 0 disables the symbol from random appearance.
   * Symbols without specified weights are assigned equal default weight (balanced among unspecified symbols).
   */
  symbolsWeights?: Record<string, number>;

  /**
   * @property {string[]} wilds - List of wild symbols.
   */
  wilds: string[];

  /**
   * @property {string[]} scatters - List of scatter symbols.
   */
  scatters: string[];

  /**
   * @property {Record<string, SymbolConfig>} symbols - Configurations for the main symbols, where the key is the symbol ID.
   */
  symbols: Record<string, SymbolConfig>;

  /**
   * @property {Record<string, SymbolConfig>} expandedSymbols - Configurations for the expanded symbols, where the key is the symbol ID.
   */
  expandedSymbols: Record<string, SymbolConfig>;

  lines: number[][];
}
