diff --git a/src/Lynx/Model/GameState.cs b/src/Lynx/Model/GameState.cs index a2f280467..67f74ccc0 100644 --- a/src/Lynx/Model/GameState.cs +++ b/src/Lynx/Model/GameState.cs @@ -9,7 +9,7 @@ public readonly struct GameState public readonly BoardSquare EnPassant; - public GameState(sbyte capturedPiece, byte castle, BoardSquare enpassant, long zobristKey) + public GameState(long zobristKey, sbyte capturedPiece, byte castle, BoardSquare enpassant) { CapturedPiece = capturedPiece; Castle = castle; diff --git a/src/Lynx/Model/Position.cs b/src/Lynx/Model/Position.cs index 28101f4be..9bb725ebc 100644 --- a/src/Lynx/Model/Position.cs +++ b/src/Lynx/Model/Position.cs @@ -338,7 +338,7 @@ public GameState MakeMove(Move move) UniqueIdentifier ^= ZobristTable.CastleHash(Castle); - return new GameState(capturedPiece, castleCopy, enpassantCopy, uniqueIdentifierCopy); + return new GameState(uniqueIdentifierCopy, capturedPiece, castleCopy, enpassantCopy); //var clone = new Position(this); //clone.UnmakeMove(move, gameState); //if (uniqueIdentifierCopy != clone.UniqueIdentifier) @@ -436,7 +436,7 @@ public GameState MakeNullMove() ZobristTable.SideHash() ^ ZobristTable.EnPassantHash((int)oldEnPassant); - return new GameState(-1, byte.MaxValue, oldEnPassant, oldUniqueIdentifier); + return new GameState(oldUniqueIdentifier, -1, byte.MaxValue, oldEnPassant); } [MethodImpl(MethodImplOptions.AggressiveInlining)]