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