From b013363d71a4792081034afbb63da37ffbd6b5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20C=C3=A1ceres?= Date: Sun, 7 Jan 2024 00:53:28 +0100 Subject: [PATCH] Reorder GameState constructor --- src/Lynx/Model/GameState.cs | 2 +- src/Lynx/Model/Position.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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)]