{
  "schemaVersion": 1,
  "atomId": "grid_board_layout.aicomponent",
  "bundleType": "aicomponent",
  "category": "layout",
  "mode": "fixed",
  "label": { "zh": "格子棋盘布局", "en": "Grid board layout" },
  "tags": ["layout", "grid", "board", "cell-size", "zoom", "pan", "drag-bounds", "threejs", "3d", "xz-plane"],
  "bindingRoles": ["gridBoardLayout"],
  "renderBackend": ["phaser", "threejs"],
  "engineVariants": {
    "phaser": {
      "imports": ["phaser.aicomponent", "responsive_2d_layout.aicomponent"],
      "scaffoldFiles": {
        "src/game/scenes/GameUI/BoardLayout.ts": { "source": "ref/BoardLayout.ts", "mode": "full", "weight": 10 }
      }
    },
    "threejs": {
      "imports": ["threejs.aicomponent"],
      "scaffoldFiles": {
        "src/game/utils/BoardLayout3D.ts": { "source": "ref/BoardLayout3D.ts", "mode": "full", "weight": 10 },
        "src/game/rendering/BoardRenderer3D.ts": { "source": "ref/BoardRenderer3D.ts", "mode": "full", "weight": 10 }
      }
    }
  },
  "sharedFiles": {
    "src/game/utils/BoardLayoutMath.ts": { "source": "ref/BoardLayoutMath.ts", "mode": "full", "weight": 10 }
  },
  "scaffold": {
    "files": {
      "src/game/scenes/GameUI/BoardLayout.ts": {
        "source": "ref/BoardLayout.ts",
        "mode": "full",
        "weight": 10
      }
    }
  },
  "imports": [
    { "slot": "engine",          "pinAtomId": "phaser.aicomponent",                "edgeKind": "requires", "bindAs": "engine" },
    { "slot": "responsiveLayout","pinAtomId": "responsive_2d_layout.aicomponent",  "edgeKind": "requires", "bindAs": "layout" }
  ],
  "exports": [
    { "name": "BoardLayout",        "kind": "module",    "location": "src/game/scenes/GameUI/BoardLayout.ts" },
    { "name": "computeBoardLayout", "kind": "function",  "location": "src/game/scenes/GameUI/BoardLayout.ts" },
    { "name": "BoardLayout3D",      "kind": "class",     "location": "src/game/utils/BoardLayout3D.ts" },
    { "name": "BoardRenderer3D",    "kind": "class",     "location": "src/game/rendering/BoardRenderer3D.ts" },
    { "name": "BoardLayoutMath",    "kind": "module",    "location": "src/game/utils/BoardLayoutMath.ts" }
  ],
  "neutralDescriptor": {
    "geometry": "dynamic cell-size calculator for a variable-size grid that fits within screen bounds or 3D camera frustum, with configurable margins and spacing",
    "layers": ["grid-math", "zoom-constraint", "pan-constraint", "3d-xz-layout"],
    "replaceable": ["margin ratio", "scale factor", "cell spacing multiplier", "zoom range", "coordinate system"]
  },
  "usageHints": [
    "computeBoardLayout() 根据 rows×cols 和可用空间计算最优格子大小和棋盘偏移（纯数学，引擎无关）",
    "BoardLayout3D 在 Three.js XZ 平面布局棋盘，getCellWorldPos(col, row) 返回世界坐标",
    "3D 模式以原点为棋盘中心，cellSize 默认 1.0 世界单位",
    "BOARD_MARGIN_RATIO 控制棋盘与屏幕边缘的留白比例（默认 0.07）",
    "CELL_SPACING_MULTIPLIER 放大格子尺寸但保持路径线宽不变，提升点击体验",
    "返回 cellSize / cellWidth / cellHeight / boardOffsetX / boardOffsetY"
  ],
  "files": {
    "skill": "SKILL.md",
    "boardLayout": "ref/BoardLayout.ts",
    "boardLayout3D": "ref/BoardLayout3D.ts",
    "boardRenderer3D": "ref/BoardRenderer3D.ts",
    "boardLayoutMath": "ref/BoardLayoutMath.ts"
  }
}
