public bool TryProbe(ulong key, out TranspositionTableEntry entry, out ulong entryKey)
        {
            //entry = default; return false;
            var index = GetTableIndex(key);

            entry = _entries[index];
            var exists = entry.Flag != TranspositionTableFlags.None;

            //entryKey = entry.Key;
            entryKey = RestoreKey(entry.PartialKey, index);
            //var exists = entry.Key != 0;
            return(exists);
        }
        public void Store(UInt64 key, Move move, int depth, int score, Byte flag)
        {
            var index         = GetTableIndex(key);
            var existingEntry = _entries[index];
            //var entryKey = existingEntry.Key;
            var entryKey = RestoreKey(existingEntry.PartialKey, index);

            // Cpw
            if (entryKey == key && existingEntry.Depth > depth)
            {
                return;
            }

            if (existingEntry.Flag == TranspositionTableFlags.Exact)
            {
                if (flag != TranspositionTableFlags.Exact)
                {
                    return;
                }
            }

            //if (existingEntry.Depth > depth && existingEntry.Key == key)
            //{
            //    return;
            //}

            // Stockfish

            /*if (flag != TranspositionTableFlags.Exact && existingEntry.Key == key && depth <= existingEntry.Depth - 4)
             * {
             *  return;
             * }*/

            var entry = new TranspositionTableEntry(key, move, (byte)depth, (short)score, flag /*, key2*/);

            _entries[index] = entry;
        }