示例#1
0
        public void RemovePosition_Connected(IPosition_Connected p)
        {
            IPositionSet_Connected_AdjacencyEdit adjSet = ((IPosition_Connected_Edit)p).GetAdjacencyPositionSetEdit();

            adjSet.InitToTraverseSet();
            while (adjSet.NextPosition())
            {
                IPosition_Connected_Edit adj = adjSet.GetPosition_Connected_Edit();
                adj.GetAdjacencyPositionSetEdit().RemoveAdjacency(p);
                adjSet.RemoveAdjacency(adj);
            }
            list.Remove(p);
        }
示例#2
0
 public bool IsConnected(IPosition_Connected_Edit p1, IPosition_Connected_Edit p2)
 {
     if (p1 != null && p2 != null)
     {
         IPositionSet_Connected_AdjacencyEdit adjSet = p1.GetAdjacencyPositionSetEdit();
         adjSet.InitToTraverseSet();
         while (adjSet.NextPosition())
         {
             if (p2.Equals(adjSet.GetPosition_Connected_Edit()))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
示例#3
0
        public void RemovePosition(float x, float y)
        {
            IPosition_Connected_Edit p = FindPosition(x, y);

            if (p != null)
            {
                mapAry[(int)x, (int)y].Remove(p);
                list.Remove(p);

                IPositionSet_Connected_AdjacencyEdit adjSet = p.GetAdjacencyPositionSetEdit();
                adjSet.InitToTraverseSet();
                while (adjSet.NextPosition())
                {
                    IPosition_Connected_Edit adj = adjSet.GetPosition_Connected_Edit();
                    adj.GetAdjacencyPositionSetEdit().RemoveAdjacency(p);
                    adjSet.RemoveAdjacency(adj);
                }
            }
        }