feat(重构): 重构棋盘和棋子的逻辑

- 重构了 ChessBoard 和 ChessPiece 类的逻辑
- 添加了新版本的 ChineseChess 库
- 删除了旧版本的 VirtualBoard 和 VirtualPiece 类
- 更新了相关的场景和脚本
This commit is contained in:
ZZY
2024-11-22 20:01:40 +08:00
parent 8ee9732a6f
commit 9c619784af
28 changed files with 1068 additions and 455 deletions

18
Scripts/Src/IPiece.cs Normal file
View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using Vector2I = Vector.Vector2I;
public interface IPiece {
Vector2I Pos { get; set; }
string Name { get; set; }
bool IsSelected { get; set; }
Dictionary<string, object> Data { get; set; }
event EventHandler<Vector2I> OnPos;
event EventHandler<Vector2I> OnMove;
event EventHandler<bool> OnSelected;
event EventHandler<string> OnName;
bool CanMove(Vector2I to);
bool Move(Vector2I pos);
}