{
  "schemaVersion": 1,
  "atomId": "path_input_handler.aicomponent",
  "bundleType": "aicomponent",
  "category": "component",
  "mode": "fixed",
  "label": { "zh": "棋盘输入处理器", "en": "Board input handler" },
  "tags": ["input", "touch", "drag", "zoom", "pinch", "hit-detection", "phaser", "board", "threejs", "raycaster", "3d"],
  "bindingRoles": ["boardInputHandler"],
  "hitDetection": ["2d-bounds", "3d-raycast"],
  "engineVariants": {
    "phaser": {
      "imports": ["phaser.aicomponent"],
      "scaffoldFiles": {
        "src/game/scenes/GameUI/InputHandler.ts": { "source": "ref/InputHandler.ts", "mode": "full", "weight": 10 }
      }
    },
    "threejs": {
      "imports": ["threejs.aicomponent"],
      "scaffoldFiles": {
        "src/game/ui/InputHandler3D.ts": { "source": "ref/InputHandler3D.ts", "mode": "full", "weight": 10 }
      }
    }
  },
  "scaffold": {
    "files": {
      "src/game/scenes/GameUI/InputHandler.ts": {
        "source": "ref/InputHandler.ts",
        "mode": "full",
        "weight": 10
      }
    }
  },
  "imports": [
    { "slot": "engine",      "pinAtomId": "phaser.aicomponent",           "edgeKind": "requires", "bindAs": "engine" },
    { "slot": "boardLayout", "pinAtomId": "grid_board_layout.aicomponent","edgeKind": "requires", "bindAs": "boardLayout" },
    { "slot": "renderer",    "pinAtomId": "path_renderer.aicomponent",    "edgeKind": "requires", "bindAs": "renderer" },
    {
      "slot": "sfxClick",
      "description": "点击/选中路径头部音效",
      "bindAs": "sfxClick",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": ["sfxClick"],
      "allowedBundleTypes": ["aiaudio"]
    },
    {
      "slot": "sfxMistake",
      "description": "操作错误/无效移动音效",
      "bindAs": "sfxMistake",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": ["sfxMistake"],
      "allowedBundleTypes": ["aiaudio"]
    },
    {
      "slot": "sfxArrowMoveError",
      "description": "箭头移动错误音效",
      "bindAs": "sfxArrowMoveError",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": ["sfxArrowMoveError"],
      "allowedBundleTypes": ["aiaudio"]
    },
    {
      "slot": "sfxAppear",
      "description": "新元素出现/弹出音效",
      "bindAs": "sfxAppear",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": ["sfxAppear"],
      "allowedBundleTypes": ["aiaudio"]
    }
  ],
  "exports": [
    { "name": "InputHandler",     "kind": "class",     "location": "src/game/scenes/GameUI/InputHandler.ts" },
    { "name": "InputGameRef",     "kind": "interface", "location": "src/game/scenes/GameUI/InputHandler.ts" },
    { "name": "InputHandler3D",   "kind": "class",     "location": "src/game/ui/InputHandler3D.ts" },
    { "name": "HitResult",        "kind": "interface", "location": "src/game/ui/InputHandler3D.ts" }
  ],
  "neutralDescriptor": {
    "geometry": "pointer event handler for a zoomable/pannable grid board with tap-to-select path heads and two-finger pinch zoom",
    "layers": ["pointer-events", "hit-detection", "drag", "pinch-zoom"],
    "replaceable": ["drag speed multiplier", "zoom range", "hit radius"]
  },
  "usageHints": [
    "InputHandler.bindEvents() 在 Phaser Scene create() 中棋盘构建完成后调用",
    "attemptMovePath() 是核心逻辑：命中路径头部 → 检查阻挡 → 触发消除或扣命",
    "支持拖拽棋盘（单指长按 + 移动）和双指缩放",
    "InputGameRef 接口定义了 InputHandler 所需的场景属性，避免循环依赖"
  ],
  "files": {
    "skill": "SKILL.md",
    "inputHandler": "ref/InputHandler.ts",
    "inputHandler3D": "ref/InputHandler3D.ts"
  }
}
