private static LegalFlag GetLegalFlag(ChessBoard board, ChessPiece piece, PiecePoint point) { LegalFlag flag = LegalFlag.None; if (piece.ActionArea.IsPointInArea(point)) { var wayPieceInfo = board.GetPieceInfo(point); if (wayPieceInfo.IsBlank()) { flag = LegalFlag.Blank; } else if (piece.CanEat(wayPieceInfo)) { flag = LegalFlag.Eatting; } else if (piece.CanFuse(wayPieceInfo)) { flag = LegalFlag.Fusion; } } return(flag); }
private static bool IsLegalPointNotBlank(LegalFlag flag) { return(flag == LegalFlag.Eatting || flag == LegalFlag.Fusion); }
private static bool IsLegalPoint(LegalFlag flag) { return(flag == LegalFlag.Blank); }
private static bool IsLegal(LegalFlag flag) { return(flag != LegalFlag.None); }