Exemple #1
0
 /// <summary>
 /// 数据合并,针对x相同的数据且y可连续的数据进行合并
 /// </summary>
 public void Combo()
 {
     if (fogMaskFixGroupY.Count >= 2)
     {
         fogMaskFixGroupY.Sort((l, r) => {
             return(l.beginY.CompareTo(r.beginY));
         });
         FogMaskFixGroupY beforePtr = null;
         FogMaskFixGroupY afterPtr  = null;
         for (int i = fogMaskFixGroupY.Count - 1; i > 0; i--)
         {
             beforePtr = fogMaskFixGroupY [i - 1];
             afterPtr  = fogMaskFixGroupY [i];
             /// 收尾相连则合并之
             if (beforePtr.endY + 1 == afterPtr.beginY)
             {
                 /// 扩展before的数组
                 beforePtr.colorArray.AddRange(afterPtr.colorArray);
                 beforePtr.endY = afterPtr.endY;
                 /// 删除after
                 FogMaskFixGroupY.Recover(afterPtr);
                 fogMaskFixGroupY.RemoveAt(i);
             }
         }
     }
 }
Exemple #2
0
 public void Clear()
 {
     for (int i = fogMaskFixGroupY.Count - 1; i >= 0; i--)
     {
         FogMaskFixGroupY.Recover(fogMaskFixGroupY [i]);
     }
     fogMaskFixGroupY.Clear();
 }