Esempio n. 1
0
 public void Combine(LeagueHashSourceCollection other)
 {
     foreach (var kvp in other._content)
     {
         foreach (var entry in kvp.Value)
         {
             AddSource(kvp.Key, entry);
         }
     }
 }
Esempio n. 2
0
 public LeagueHashCollection(LeagueHashSourceCollection hashSources)
 {
     _hashes = new Dictionary <uint, Dictionary <string, HashSet <string> > >();
     foreach (var kvp in hashSources.Content)
     {
         foreach (var name in kvp.Value)
         {
             AddFromSource(kvp.Key, name);
         }
     }
 }
Esempio n. 3
0
        public LeagueHashSourceCollection GetResult()
        {
            if (_result != null)
            {
                return(_result);
            }
            _result = new LeagueHashSourceCollection();

            foreach (var worker in _workers)
            {
                _result.Combine(worker.GetResult());
            }

            return(_result);
        }
Esempio n. 4
0
        private void Work()
        {
            _finished = false;
            _result   = new LeagueHashSourceCollection();
            Progress  = 0;
            var end = _start + _count;

            for (var i = _start; i < end && i < _sources.Length; i++)
            {
                for (var j = 0; j < _sources.Length; j++)
                {
                    var hash = LeagueLib.Hashes.HashFunctions.GetInibinHash(_sources[i], _sources[j]);
                    if (_hashes.Contains(hash))
                    {
                        _result.AddSource(_sources[i], _sources[j]);
                    }
                    Progress++;
                }
            }
            _finished = true;
        }