public static bool NameExist(Shadow shadow) { foreach (var pair in _dict) { foreach (var s in pair.Value) { if (s.ID == shadow.ID && s.Variance == shadow.Variance) { return(true); } } } return(false); }
static void AddToDict(Shadow shadow, bool overwrite = false) { if (!_dict.ContainsKey(shadow.Hash)) { _dict[shadow.Hash] = new List <Shadow>(); } if (overwrite) { foreach (var pair in _dict.ToArray()) { pair.Value.RemoveAll(u => u.ID == shadow.ID && u.Variance == shadow.Variance); } _dict[shadow.Hash].Clear(); } _dict[shadow.Hash].Add(shadow); if (shadow.Variance == 'f') { _genderdiff.Add(shadow.ID); } }
public static Shadow[] Find(Shadow shadow) { return(Find(shadow.Hash)); }