public void Add(Processor p) { CheckProcessorSizes(p); void SetProps() { _procNames.Add(char.ToUpper(p.Tag[0])); Count++; IsEmpty = false; } int hash = HashCreator.GetHash(p); if (_dicProcsWithTag.TryGetValue(hash, out List <Processor> prcs)) { if (prcs.Any(prc => ProcessorCompare(prc, p, true))) { return; } prcs.Add(GetUniqueProcessor(p)); SetProps(); return; } _dicProcsWithTag.Add(hash, new List <Processor> { GetUniqueProcessor(p) }); SetProps(); }
/// <inheritdoc /> public override int GetHashCode(Processor obj) => HashCreator.GetHash(obj);