コード例 #1
0
 internal static MoveResult CurrentStatus(OmokBoard b, Player p, Point move)
 {
     Lines sucessive = GetConsecutiveLines(b, p.Color, move);
     if (sucessive.horizontal == 5 || sucessive.vertical == 5 || sucessive.mainDiagonal == 5 || sucessive.antiDiagonal == 5)
         return MoveResult.FIVE_IN_A_ROW;
     for (int i = 0; i < OmokBoard.ROWS; i++)
         for (int j = 0; j < OmokBoard.COLUMNS; j++)
             if (b.GetPiece(i, j) == PieceColor.EMPTY)
                 return MoveResult.NORMAL;
     return MoveResult.BOARD_FILLED;
 }
コード例 #2
0
 internal static MoveResult CanMove(OmokBoard b, Player p, Point move)
 {
     Lines sucessive = GetConsecutiveLines(b, p.Color, move);
     if (sucessive.horizontal > 5 || sucessive.vertical > 5 || sucessive.mainDiagonal > 5 || sucessive.antiDiagonal > 5)
         return MoveResult.OVERLINE;
     if (sucessive.horizontal == 3 && (sucessive.vertical == 3 || sucessive.mainDiagonal == 3 || sucessive.antiDiagonal == 3)
             || sucessive.vertical == 3 && (sucessive.mainDiagonal == 3 || sucessive.antiDiagonal == 3)
             || sucessive.mainDiagonal == 3 && sucessive.antiDiagonal == 3)
         return MoveResult.DOUBLE_THREES;
     return MoveResult.NORMAL;
 }