示例#1
0
 public static ChessPieceMoveDefinition RookStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (rookStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         rookStandardRankMoveDefinition = new ChessPieceMoveDefinition(0, 8, 8, ChessPieceMoveDirections.PositiveRank | ChessPieceMoveDirections.NegativeRank);
     }
     return(rookStandardRankMoveDefinition);
 }
示例#2
0
 public static ChessPieceMoveDefinition KnightStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (knightStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         knightStandardRankMoveDefinition = new ChessPieceMoveDefinition(1, 2, 1, ChessPieceMoveDirections.AscendingDiagonal | ChessPieceMoveDirections.DescendingDiagonal);
     }
     return(knightStandardRankMoveDefinition);
 }
示例#3
0
 public static ChessPieceMoveDefinition QueenStandardDiagonalMoveDefinition(ChessPieceColor orientation)
 {
     if (queenStandardDiagonalMoveDefinition == default(ChessPieceMoveDefinition))
     {
         queenStandardDiagonalMoveDefinition = new ChessPieceMoveDefinition(1, 1, 8, ChessPieceMoveDirections.AscendingDiagonal | ChessPieceMoveDirections.DescendingDiagonal);
     }
     return(queenStandardDiagonalMoveDefinition);
 }
示例#4
0
 public static ChessPieceMoveDefinition QueenStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (queenStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         queenStandardRankMoveDefinition = new ChessPieceMoveDefinition(0, 1, 8, ChessPieceMoveDirections.Rank);
     }
     return(queenStandardRankMoveDefinition);
 }
示例#5
0
 public static ChessPieceMoveDefinition QueenStandardFileMoveDefinition(ChessPieceColor orientation)
 {
     if (queenStandardFileMoveDefinition == default(ChessPieceMoveDefinition))
     {
         queenStandardFileMoveDefinition = new ChessPieceMoveDefinition(1, 0, 8, ChessPieceMoveDirections.File);
     }
     return(queenStandardFileMoveDefinition);
 }
示例#6
0
 public static ChessPieceMoveDefinition KingStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (kingStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         kingStandardRankMoveDefinition = new ChessPieceMoveDefinition(0, 1, 1, ChessPieceMoveDirections.Rank);
     }
     return(kingStandardRankMoveDefinition);
 }
示例#7
0
 public static ChessPieceMoveDefinition BishopStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (bishopStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         bishopStandardRankMoveDefinition = new ChessPieceMoveDefinition(1, 1, 8, ChessPieceMoveDirections.AscendingDiagonal | ChessPieceMoveDirections.DescendingDiagonal);
     }
     return(bishopStandardRankMoveDefinition);
 }
示例#8
0
 public static ChessPieceMoveDefinition PawnAttackMoveDefinition(ChessPieceColor orientation)
 {
     if (whitePawnAttackFileMoveDefinition == default(ChessPieceMoveDefinition))
     {
         whitePawnAttackFileMoveDefinition = new ChessPieceMoveDefinition(1, 1, 1, ChessPieceMoveDirections.PositiveFile | ChessPieceMoveDirections.PositiveRank);
     }
     if (blackPawnAttackFileMoveDefinition == default(ChessPieceMoveDefinition))
     {
         blackPawnAttackFileMoveDefinition = new ChessPieceMoveDefinition(1, 1, 1, ChessPieceMoveDirections.PositiveFile | ChessPieceMoveDirections.PositiveRank);
     }
     return(orientation == ChessPieceColor.White ? whitePawnAttackFileMoveDefinition : blackPawnAttackFileMoveDefinition);
 }
示例#9
0
 public static ChessPieceMoveDefinition PawnStandardMoveDefinition(ChessPieceColor orientation)
 {
     if (whitePawnStandardFileMoveDefinition == default(ChessPieceMoveDefinition))
     {
         whitePawnStandardFileMoveDefinition = new ChessPieceMoveDefinition(1, 0, 1, ChessPieceMoveDirections.PositiveFile);
     }
     if (blackPawnStandardFileMoveDefinition == default(ChessPieceMoveDefinition))
     {
         blackPawnStandardFileMoveDefinition = new ChessPieceMoveDefinition(1, 0, 1, ChessPieceMoveDirections.NegativeFile);
     }
     return(orientation == ChessPieceColor.White ? whitePawnStandardFileMoveDefinition : blackPawnStandardFileMoveDefinition);
 }