wsy182 2024-12-01 17:36:03 +08:00
parent fc1259d0e2
commit 840d44b773
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,6 @@ class ChengduMahjongEngine:
# AI 决策是否杠牌
if should_gang(current_player, self.state, gang_type):
self.state.hands[current_player].perform_gang() # 执行杠操作
self.state.print_game_state(current_player)
# 计算杠牌得分

View File

@ -12,9 +12,10 @@ class Hand:
""" 向手牌中添加一张牌 """
if not isinstance(tile, MahjongTile):
raise ValueError("必须添加 MahjongTile 类型的牌")
if len(self.tiles) >= 14:
raise ValueError("手牌数量不能超过 14 张")
self.tiles.append(tile) # 将牌添加到手牌中
self.tile_count[tile] += 1 # 增加牌的数量
def remove_tile(self, tile):
""" 从手牌中移除一张牌 """
if not isinstance(tile, MahjongTile):