Exemple #1
0
 public static ChessPieceMoveDefinition RookStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (rookStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         rookStandardRankMoveDefinition = new ChessPieceMoveDefinition(0, 8, 8, ChessPieceMoveDirections.PositiveRank | ChessPieceMoveDirections.NegativeRank);
     }
     return(rookStandardRankMoveDefinition);
 }
Exemple #2
0
 public static ChessPieceMoveDefinition KnightStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (knightStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         knightStandardRankMoveDefinition = new ChessPieceMoveDefinition(1, 2, 1, ChessPieceMoveDirections.AscendingDiagonal | ChessPieceMoveDirections.DescendingDiagonal);
     }
     return(knightStandardRankMoveDefinition);
 }
Exemple #3
0
 public static ChessPieceMoveDefinition QueenStandardDiagonalMoveDefinition(ChessPieceColor orientation)
 {
     if (queenStandardDiagonalMoveDefinition == default(ChessPieceMoveDefinition))
     {
         queenStandardDiagonalMoveDefinition = new ChessPieceMoveDefinition(1, 1, 8, ChessPieceMoveDirections.AscendingDiagonal | ChessPieceMoveDirections.DescendingDiagonal);
     }
     return(queenStandardDiagonalMoveDefinition);
 }
Exemple #4
0
 public static ChessPieceMoveDefinition QueenStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (queenStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         queenStandardRankMoveDefinition = new ChessPieceMoveDefinition(0, 1, 8, ChessPieceMoveDirections.Rank);
     }
     return(queenStandardRankMoveDefinition);
 }
Exemple #5
0
 public static ChessPieceMoveDefinition QueenStandardFileMoveDefinition(ChessPieceColor orientation)
 {
     if (queenStandardFileMoveDefinition == default(ChessPieceMoveDefinition))
     {
         queenStandardFileMoveDefinition = new ChessPieceMoveDefinition(1, 0, 8, ChessPieceMoveDirections.File);
     }
     return(queenStandardFileMoveDefinition);
 }
Exemple #6
0
 public static ChessPieceMoveDefinition KingStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (kingStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         kingStandardRankMoveDefinition = new ChessPieceMoveDefinition(0, 1, 1, ChessPieceMoveDirections.Rank);
     }
     return(kingStandardRankMoveDefinition);
 }
Exemple #7
0
 public static ChessPieceMoveDefinition BishopStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (bishopStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         bishopStandardRankMoveDefinition = new ChessPieceMoveDefinition(1, 1, 8, ChessPieceMoveDirections.AscendingDiagonal | ChessPieceMoveDirections.DescendingDiagonal);
     }
     return(bishopStandardRankMoveDefinition);
 }
Exemple #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);
 }
Exemple #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);
 }