feat(chinese-chess): 实现中国象棋核心逻辑和基本功能
- 抽象出 ChessCore 类,包含游戏初始化、行棋逻辑、悔棋等功能 - 重构 Player 类,优化行棋和记录逻辑 - 更新 ChessBoard 和 ChessPiece 类,适应新逻辑 - 移除冗余代码,提高代码可读性和可维护性
This commit is contained in:
@ -55,10 +55,9 @@ public class VirtualBoard {
|
||||
if (GetPiece(arrayPos) != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
OnInsert?.Invoke(this, piece);
|
||||
SetPiecePos(piece, arrayPos);
|
||||
|
||||
SetPiecePos(piece, arrayPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -74,7 +73,6 @@ public class VirtualBoard {
|
||||
OnMove?.Invoke(this, new MoveEventArgs { From = from, To = to });
|
||||
|
||||
SetPiecePos(SetPiecePos(null, from), to);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user