Initial commit: boardgame-core with build fixes

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
hyper
2026-03-31 18:01:57 +08:00
co-authored by Qwen-Coder
commit d27948fbfc
39 changed files with 8545 additions and 0 deletions
+81
View File
@@ -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
+57
View File
@@ -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