Esempio n. 1
0
 public void Clear()
 {
     LastMove = Move.EmptyMove;
     NonPawnMaterial.Clear();
     PawnStructureKey = Key = 0ul;
     PliesFromNull    = Repetition = 0;
     CastlelingRights = CastlelingRights.None;
     EnPassantSquare  = Square.None;
     CheckedSquares.Fill(BitBoard.Empty);
     Pinners.Fill(BitBoard.Empty);
     BlockersForKing.Fill(BitBoard.Empty);
     CapturedPiece = Piece.EmptyPiece;
     Previous      = null;
 }
Esempio n. 2
0
 public bool Equals(State other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     // if (ReferenceEquals(this, other)) return true;
     return(LastMove.Equals(other.LastMove) &&
            Key.Equals(other.Key) &&
            PawnStructureKey.Equals(other.PawnStructureKey) &&
            EnPassantSquare.Equals(other.EnPassantSquare) &&
            CastlelingRights == other.CastlelingRights &&
            NonPawnMaterial.First() == other.NonPawnMaterial.First() &&
            NonPawnMaterial.Last() == other.NonPawnMaterial.Last() &&
            PliesFromNull == other.PliesFromNull &&
            Rule50 == other.Rule50 &&
            Pinners.Equals(other.Pinners) &&
            Checkers.Equals(other.Checkers) &&
            CapturedPiece == other.CapturedPiece &&
            Equals(Previous, other.Previous));
 }