Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo n.º 4
0
 public static ChessPieceMoveDefinition QueenStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (queenStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         queenStandardRankMoveDefinition = new ChessPieceMoveDefinition(0, 1, 8, ChessPieceMoveDirections.Rank);
     }
     return(queenStandardRankMoveDefinition);
 }
Exemplo n.º 5
0
 public static ChessPieceMoveDefinition QueenStandardFileMoveDefinition(ChessPieceColor orientation)
 {
     if (queenStandardFileMoveDefinition == default(ChessPieceMoveDefinition))
     {
         queenStandardFileMoveDefinition = new ChessPieceMoveDefinition(1, 0, 8, ChessPieceMoveDirections.File);
     }
     return(queenStandardFileMoveDefinition);
 }
Exemplo n.º 6
0
 public static ChessPieceMoveDefinition KingStandardRankMoveDefinition(ChessPieceColor orientation)
 {
     if (kingStandardRankMoveDefinition == default(ChessPieceMoveDefinition))
     {
         kingStandardRankMoveDefinition = new ChessPieceMoveDefinition(0, 1, 1, ChessPieceMoveDirections.Rank);
     }
     return(kingStandardRankMoveDefinition);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }