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); }
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); }
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); } } }