{
  "schemaVersion": 1,
  "atomId": "2048_core.aigameplay",
  "bundleType": "aigameplay",
  "category": "gameplay",
  "mode": "fixed",
  "label": {
    "zh": "2048 滑动合并",
    "en": "2048 Slide & Merge gameplay"
  },
  "tags": [
    "gameplay",
    "2048",
    "slide",
    "merge",
    "casual",
    "grid",
    "number"
  ],
  "bindingRoles": [
    "gameplayRule"
  ],
  "imports": [
    {
      "slot": "engine",
      "pinAtomId": "phaser.aicomponent",
      "edgeKind": "requires",
      "bindAs": "engine"
    },
    {
      "slot": "bgMusic",
      "description": "背景循环音乐",
      "bindAs": "bgm",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": [
        "bgMusic"
      ],
      "allowedBundleTypes": [
        "aiaudio"
      ],
      "constraints": {
        "loop": true
      }
    },
    {
      "slot": "background",
      "description": "游戏背景图",
      "bindAs": "bg",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": [
        "backgroundTexture"
      ],
      "allowedBundleTypes": [
        "aiimage"
      ]
    },
    {
      "slot": "tutorial",
      "description": "新手引导浮层",
      "bindAs": "tutorial",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": [
        "tutorialOverlay"
      ],
      "allowedBundleTypes": [
        "aicomponent"
      ]
    },
    {
      "slot": "winPanel",
      "description": "通关反馈面板视觉",
      "bindAs": "winPanel",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": [
        "successFeedbackPanel"
      ],
      "allowedBundleTypes": [
        "aiimage"
      ]
    },
    {
      "slot": "losePanel",
      "description": "失败反馈面板视觉",
      "bindAs": "losePanel",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": [
        "failFeedbackPanel"
      ],
      "allowedBundleTypes": [
        "aiimage"
      ]
    },
    {
      "slot": "endScreen",
      "description": "可玩广告结算屏（含 CTA 按钮）",
      "bindAs": "endScreen",
      "required": false,
      "edgeKind": "compatibleWith",
      "matchBindingRoles": [
        "playableEndScreenLayout"
      ],
      "allowedBundleTypes": [
        "aicomponent"
      ]
    }
  ],
  "generation": {
    "kind": "pgs",
    "pgsVersion": "1.0",
    "gameplayType": "2048",
    "rules": {
      "gridSize": 4,
      "winValue": 2048,
      "spawnValues": [
        2,
        4
      ],
      "spawnWeights": [
        0.9,
        0.1
      ],
      "mergeOncePerSlide": true
    }
  },
  "result": {
    "outputFile": "reducer.ts",
    "format": "typescript",
    "constraints": {
      "testCasesMustPass": true
    }
  },
  "binding": {
    "role": "gameplayRule",
    "target": "game/gameplay/2048/reducer.ts",
    "type": "gameplay-module-reference",
    "constraints": {
      "interface": [
        "init(config)",
        "dispatch(action)",
        "getState()",
        "slideBoard(board, direction)",
        "mergeTiles(board, direction)",
        "spawnTile(board)",
        "hasValidMoves(board)",
        "calculateScore(merges)"
      ]
    }
  },
  "files": {
    "skill": "SKILL.md",
    "pgsSchema": "ref/pgs-schema.json",
    "reducerTemplate": "ref/reducer.template.ts"
  }
}
