Initial commit: boardgame-core with build fixes
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"id": "card-play-001",
|
||||
"name": "Play Card",
|
||||
"description": "Draw a card from deck and play it to discard pile",
|
||||
"steps": [
|
||||
{
|
||||
"action": "createCard",
|
||||
"params": {
|
||||
"id": "card-hearts-10",
|
||||
"suit": "hearts",
|
||||
"value": 10,
|
||||
"name": "10 of Hearts"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createPlacement",
|
||||
"params": {
|
||||
"id": "placement-card-1",
|
||||
"partId": "card-hearts-10",
|
||||
"regionId": "player-hand",
|
||||
"faceUp": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "addPlacementToRegion",
|
||||
"params": {
|
||||
"regionId": "player-hand",
|
||||
"placementId": "placement-card-1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "setPlacementFace",
|
||||
"params": {
|
||||
"placementId": "placement-card-1",
|
||||
"faceUp": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "movePlacement",
|
||||
"params": {
|
||||
"placementId": "placement-card-1",
|
||||
"targetRegionId": "discard"
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.0",
|
||||
"category": "action",
|
||||
"cardGame": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
# Board Game CLI Commands
|
||||
# 命令格式:<command> <args> [--flags]
|
||||
|
||||
# ========== 游戏设置 ==========
|
||||
|
||||
# 创建游戏区域
|
||||
region board keyed --name="Game Board"
|
||||
region supply unkeyed --name=Supply
|
||||
region discard unkeyed --name="Discard Pile"
|
||||
region hand unkeyed --name=Hand --capacity=5
|
||||
|
||||
# 设置游戏阶段
|
||||
phase setup
|
||||
|
||||
# ========== 创建组件 ==========
|
||||
|
||||
# 创建棋子
|
||||
create meeple red-1 --color=red --name="Red Player 1"
|
||||
create meeple blue-1 --color=blue --name="Blue Player 1"
|
||||
|
||||
# 创建卡牌
|
||||
create card hearts-10 --suit=hearts --value=10
|
||||
create card spades-ace --suit=spades --value=ace
|
||||
|
||||
# 创建板块
|
||||
create tile forest-1 --pattern=forest --rotation=90
|
||||
|
||||
# ========== 放置组件 ==========
|
||||
|
||||
# 放置棋子到版图
|
||||
place red-1 board 3 4 --rotation=0 --faceup=true
|
||||
|
||||
# 放置卡牌到手牌(面朝下)
|
||||
place hearts-10 hand 0 0 --faceup=false
|
||||
|
||||
# ========== 移动和操作 ==========
|
||||
|
||||
# 移动棋子
|
||||
move red-1 board --key=B3
|
||||
|
||||
# 翻转卡牌
|
||||
flip hearts-10
|
||||
|
||||
# 旋转板块
|
||||
rotate forest-1 180
|
||||
|
||||
# 设置位置
|
||||
position red-1 5 2
|
||||
|
||||
# 交换两个棋子
|
||||
swap red-1 blue-1
|
||||
|
||||
# ========== 卡牌操作 ==========
|
||||
|
||||
# 抽牌
|
||||
draw supply 1 --to=hand
|
||||
|
||||
# 洗牌(带种子)
|
||||
shuffle discard --seed=2026
|
||||
|
||||
# 出牌到弃牌堆
|
||||
discard hearts-10 --to=discard
|
||||
|
||||
# ========== 清理 ==========
|
||||
|
||||
# 清空区域
|
||||
clear hand
|
||||
|
||||
# 移除组件
|
||||
remove part red-1
|
||||
remove placement p1
|
||||
remove region temp
|
||||
|
||||
# ========== 帮助 ==========
|
||||
|
||||
# 显示所有命令
|
||||
help
|
||||
|
||||
# 显示特定命令帮助
|
||||
help move
|
||||
help shuffle
|
||||
@@ -0,0 +1,57 @@
|
||||
# Movement Commands Examples
|
||||
# 移动命令示例
|
||||
|
||||
# ========== 基本移动 ==========
|
||||
|
||||
# 简单移动
|
||||
move piece-1 board
|
||||
|
||||
# 移动到指定槽位
|
||||
move piece-1 board --key=A1
|
||||
|
||||
# ========== 位置操作 ==========
|
||||
|
||||
# 设置精确位置
|
||||
position piece-1 0 0
|
||||
position piece-1 3 5
|
||||
position piece-1 -2 4
|
||||
|
||||
# 旋转
|
||||
rotate tile-1 90
|
||||
rotate tile-1 180
|
||||
rotate tile-1 270
|
||||
rotate tile-1 -45
|
||||
|
||||
# ========== 翻转 ==========
|
||||
|
||||
# 翻转(切换面朝上/下)
|
||||
flip card-1
|
||||
flip tile-2
|
||||
|
||||
# ========== 交换 ==========
|
||||
|
||||
# 交换两个棋子位置
|
||||
swap meeple-1 meeple-2
|
||||
|
||||
# ========== 组合移动示例 ==========
|
||||
|
||||
# 移动并旋转
|
||||
move knight-1 board --key=C3
|
||||
rotate knight-1 45
|
||||
|
||||
# 移动并设置位置
|
||||
move bishop-1 board
|
||||
position bishop-1 4 4
|
||||
|
||||
# ========== 高级用法 ==========
|
||||
|
||||
# 移动多个棋子(需要多行)
|
||||
move rook-1 board --key=A1
|
||||
move rook-2 board --key=H1
|
||||
move king-1 board --key=E1
|
||||
move queen-1 board --key=D1
|
||||
|
||||
# 批量翻转
|
||||
flip card-1
|
||||
flip card-2
|
||||
flip card-3
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"id": "combo-001",
|
||||
"name": "Combo Move",
|
||||
"description": "A complex combo: place meeple, move it, then flip a card",
|
||||
"steps": [
|
||||
{
|
||||
"action": "createMeeple",
|
||||
"params": {
|
||||
"id": "meeple-blue-1",
|
||||
"color": "blue"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createPlacement",
|
||||
"params": {
|
||||
"id": "placement-blue-1",
|
||||
"partId": "meeple-blue-1",
|
||||
"regionId": "supply",
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "movePlacement",
|
||||
"params": {
|
||||
"placementId": "placement-blue-1",
|
||||
"targetRegionId": "board",
|
||||
"key": "A1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "updatePlacementPosition",
|
||||
"params": {
|
||||
"placementId": "placement-blue-1",
|
||||
"position": {
|
||||
"x": 1,
|
||||
"y": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createCard",
|
||||
"params": {
|
||||
"id": "card-spades-ace",
|
||||
"suit": "spades",
|
||||
"value": "ace"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createPlacement",
|
||||
"params": {
|
||||
"id": "placement-card-ace",
|
||||
"partId": "card-spades-ace",
|
||||
"regionId": "discard",
|
||||
"faceUp": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "flipPlacement",
|
||||
"params": {
|
||||
"placementId": "placement-card-ace"
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.0",
|
||||
"category": "combo",
|
||||
"difficulty": "medium"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"id": "move-meeple-001",
|
||||
"name": "Move Meeple",
|
||||
"description": "Move a meeple from one position to another on the board",
|
||||
"steps": [
|
||||
{
|
||||
"action": "updatePlacementPosition",
|
||||
"params": {
|
||||
"placementId": "placement-red-1",
|
||||
"position": {
|
||||
"x": 5,
|
||||
"y": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.0",
|
||||
"category": "action",
|
||||
"playerCount": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"id": "phase-change-001",
|
||||
"name": "Phase Change",
|
||||
"description": "Change the game phase with setup steps",
|
||||
"steps": [
|
||||
{
|
||||
"action": "setPhase",
|
||||
"params": {
|
||||
"phase": "setup"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createRegion",
|
||||
"params": {
|
||||
"id": "board",
|
||||
"type": "keyed",
|
||||
"name": "Game Board"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "setPhase",
|
||||
"params": {
|
||||
"phase": "main"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createMeeple",
|
||||
"params": {
|
||||
"id": "meeple-green-1",
|
||||
"color": "green"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "setPhase",
|
||||
"params": {
|
||||
"phase": "end"
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.0",
|
||||
"category": "game-flow"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"id": "place-meeple-001",
|
||||
"name": "Place Meeple",
|
||||
"description": "Place a meeple on the board at specified position",
|
||||
"steps": [
|
||||
{
|
||||
"action": "createMeeple",
|
||||
"params": {
|
||||
"id": "meeple-red-1",
|
||||
"color": "red",
|
||||
"name": "Red Meeple 1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createPlacement",
|
||||
"params": {
|
||||
"id": "placement-red-1",
|
||||
"partId": "meeple-red-1",
|
||||
"regionId": "board",
|
||||
"position": {
|
||||
"x": 3,
|
||||
"y": 4
|
||||
},
|
||||
"rotation": 0,
|
||||
"faceUp": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "setSlot",
|
||||
"params": {
|
||||
"regionId": "board",
|
||||
"key": "C4",
|
||||
"placementId": "placement-red-1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.0",
|
||||
"category": "action",
|
||||
"playerCount": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"id": "setup-game-001",
|
||||
"name": "Setup Game",
|
||||
"description": "Initialize the game board with basic regions and starting components",
|
||||
"steps": [
|
||||
{
|
||||
"action": "createRegion",
|
||||
"params": {
|
||||
"id": "board",
|
||||
"type": "keyed",
|
||||
"name": "Game Board"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createRegion",
|
||||
"params": {
|
||||
"id": "supply",
|
||||
"type": "unkeyed",
|
||||
"name": "Supply"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createRegion",
|
||||
"params": {
|
||||
"id": "discard",
|
||||
"type": "unkeyed",
|
||||
"name": "Discard Pile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createRegion",
|
||||
"params": {
|
||||
"id": "player-hand",
|
||||
"type": "unkeyed",
|
||||
"name": "Player Hand",
|
||||
"capacity": 5
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.0",
|
||||
"category": "setup"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"id": "tile-place-001",
|
||||
"name": "Place Tile",
|
||||
"description": "Place a terrain tile on the board with rotation",
|
||||
"steps": [
|
||||
{
|
||||
"action": "createTile",
|
||||
"params": {
|
||||
"id": "tile-forest-1",
|
||||
"pattern": "forest",
|
||||
"rotation": 90,
|
||||
"name": "Forest Tile 1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "createPlacement",
|
||||
"params": {
|
||||
"id": "placement-tile-1",
|
||||
"partId": "tile-forest-1",
|
||||
"regionId": "board",
|
||||
"position": {
|
||||
"x": 2,
|
||||
"y": 3
|
||||
},
|
||||
"rotation": 90,
|
||||
"faceUp": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"action": "setSlot",
|
||||
"params": {
|
||||
"regionId": "board",
|
||||
"key": "B3",
|
||||
"placementId": "placement-tile-1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.0",
|
||||
"category": "action",
|
||||
"tileGame": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user