/** Inventory + item definitions — GDD §6.3. */

export type ItemCategory = "key" | "consumable" | "weapon" | "ammo" | "document";

export interface ItemDef {
  id: string;
  name: string;
  description: string;
  category: ItemCategory;
  /** Key items cannot be discarded and do not consume a normal slot. */
  isKeyItem?: boolean;
  stackable?: boolean;
  maxStack?: number;
  /** Icon colour, standing in for a sprite until the item pipeline lands. */
  iconColor?: number;
}

export interface ItemStack {
  itemId: string;
  quantity: number;
}

/** Recipe for GDD §6.3 item combination. Order-independent. */
export interface CombinationDef {
  inputs: [string, string];
  output: ItemStack;
  /** Consume the inputs, or keep them (e.g. a tool used on a component). */
  consumes?: [boolean, boolean];
}

export interface InventoryState {
  slots: (ItemStack | null)[];
  capacity: number;
  /**
   * Key items are held outside the slot array — they must not compete for
   * capacity, or a full inventory could soft-lock a puzzle.
   */
  keyItems: string[];
}
