public Move(int TurnNo, int LastMoveTurnNo, Move.enmName Name, Piece Piece, Square From, Square To, Piece PieceTaken, int PieceTakenOrdinal, int Score) { m_TurnNo = TurnNo; m_LastMoveTurnNo = LastMoveTurnNo; m_Name = Name; m_Piece = Piece; m_From = From; m_To = To; m_PieceTaken = PieceTaken; m_PieceTakenOrdinal = PieceTakenOrdinal; m_Score = Score; }
public static Move MakeAMove(Move.enmName MoveName, Piece piece, Square square) { m_movesRedoList.Clear(); Move move = piece.Move(MoveName, square); move.EnemyStatus = move.Piece.Player.OtherPlayer.Status; m_playerToPlay.Clock.Stop(); m_movesHistory.Last.TimeStamp = m_playerToPlay.Clock.TimeElapsed; m_playerToPlay = m_playerToPlay.OtherPlayer; m_playerToPlay.Clock.Start(); return(move); }
public unsafe static void RecordHash(ulong HashCodeA, ulong HashCodeB, int depth, int val, enmHashType type, int From, int To, Move.enmName MoveName, Player.enmColour colour) { m_intWrites++; fixed(HashEntry *phashBase = &m_arrHashEntry[0]) { int intAttempt; HashEntry *phashEntry = phashBase; phashEntry += ((uint)(HashCodeA % HASH_TABLE_SIZE)); HashEntry *phashFirst = phashEntry; intAttempt = 0; while (phashEntry >= phashBase && phashEntry->HashCodeA != 0 && phashEntry->Depth > depth) { phashEntry--; intAttempt++; if (intAttempt == HASH_TABLE_SLOT_DEPTH) { break; } } if (phashEntry < phashBase) { phashEntry = phashBase; } if (phashEntry->HashCodeA != 0) { m_intCollisions++; if (phashEntry->HashCodeA != HashCodeA || phashEntry->HashCodeB != HashCodeB) { m_intOverwrites++; phashEntry->WhiteFrom = -1; phashEntry->BlackFrom = -1; } } phashEntry->HashCodeA = HashCodeA; phashEntry->HashCodeB = HashCodeB; phashEntry->Result = val; phashEntry->Type = type; phashEntry->Depth = (sbyte)depth; phashEntry->Colour = colour; if (From > -1) { if (colour == Player.enmColour.White) { phashEntry->WhiteMoveName = MoveName; phashEntry->WhiteFrom = (sbyte)From; phashEntry->WhiteTo = (sbyte)To; } else { phashEntry->BlackMoveName = MoveName; phashEntry->BlackFrom = (sbyte)From; phashEntry->BlackTo = (sbyte)To; } } } }
public void Add(int TurnNo, int LastMoveTurnNo, Move.enmName Name, Piece Piece, Square From, Square To, Piece PieceTaken, int PieceTakenOrdinal, int Score) { m_colMoves.Add(new Move(TurnNo, LastMoveTurnNo, Name, Piece, From, To, PieceTaken, PieceTakenOrdinal, Score)); }