Beispiel #1
0
        public void NormalizeVertexPinList()
        {
            if (VertexPinList.Count <= 0)
            {
                return;
            }
            SortVertexPinList();
            bool[] array = new bool[VertexPinList.Count];
            array[0] = false;
            for (int i = 1; i < VertexPinList.Count; i++)
            {
                VertexPin vertexPin  = VertexPinList[i - 1];
                VertexPin vertexPin2 = VertexPinList[i];
                if (vertexPin.Vertex == vertexPin2.Vertex)
                {
                    array[i] = true;
                }
            }
            Dictionary <int, int> dictionary = new Dictionary <int, int>();

            foreach (BodyAnchor bodyAnchor in BodyAnchorList)
            {
                dictionary.Add(bodyAnchor.Vertex, 0);
            }
            for (int j = 0; j < VertexPinList.Count; j++)
            {
                int vertex = VertexPinList[j].Vertex;
                if (dictionary.ContainsKey(vertex))
                {
                    array[j] = true;
                }
            }
            for (int num = array.Length - 1; num > 0; num--)
            {
                if (array[num])
                {
                    VertexPinList.RemoveAt(num);
                }
            }
        }