示例#1
0
 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);
 }
示例#2
0
 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);
     }
 }
示例#3
0
 public static Shadow[] GetMatchedShadows()
 {
     return(Shadow.Find(new Shadow(GetImage(Shadow.X, Shadow.Y, Shadow.W, Shadow.H))));
 }
示例#4
0
 public static Shadow[] Find(Shadow shadow)
 {
     return(Find(shadow.Hash));
 }