feat(重构): 重构棋盘和棋子的逻辑
- 重构了 ChessBoard 和 ChessPiece 类的逻辑 - 添加了新版本的 ChineseChess 库 - 删除了旧版本的 VirtualBoard 和 VirtualPiece 类 - 更新了相关的场景和脚本
This commit is contained in:
18
Scripts/Src/IPiece.cs
Normal file
18
Scripts/Src/IPiece.cs
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user