- 移除了.csproj文件 - 更新了.gitignore,添加了.editorconfig - 重构了IBoard和IPiece接口,引入了新的事件处理机制 - 优化了CCBoard、CCPiece等类的实现,使用新的事件驱动模型 - 删除了冗余代码,提高了代码的可读性和可维护性
23 lines
615 B
C#
23 lines
615 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Vector2I = Vector.Vector2I;
|
|
|
|
|
|
public interface IPiece {
|
|
public interface IPieceOn {
|
|
void OnPos(object self, Vector2I oldPos) {}
|
|
void OnMove(object self, Vector2I oldPos) {}
|
|
void OnSelected(object self, bool oldIsSelected) {}
|
|
void OnName(object self, string oldName) {}
|
|
}
|
|
|
|
IPieceOn? On { get; protected set; }
|
|
Vector2I Pos { get; set; }
|
|
string Name { get; set; }
|
|
bool IsSelected { get; set; }
|
|
Dictionary<string, object> Data { get; set; }
|
|
|
|
bool CanMove(Vector2I to);
|
|
bool Move(Vector2I pos);
|
|
}
|