Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 private static bool IsLegalPointNotBlank(LegalFlag flag)
 {
     return(flag == LegalFlag.Eatting || flag == LegalFlag.Fusion);
 }
Ejemplo n.º 3
0
 private static bool IsLegalPoint(LegalFlag flag)
 {
     return(flag == LegalFlag.Blank);
 }
Ejemplo n.º 4
0
 private static bool IsLegal(LegalFlag flag)
 {
     return(flag != LegalFlag.None);
 }