예제 #1
0
        public bool removeVertex(Vertex v)
        {
            foreach (Edge e in v.incidentEdges())
            {
                edges.Remove(e);
            }

            //remove from <vertexId, vertex> structure
            vertices.Remove(v.getId());
            //remove from <floorNum, List<Vertex> structure
            bool hasLocation = v.getLocation() != null && v.getLocation().getAbsoluteLocation() != null;

            if (hasLocation)
            {
                int floor = (int)v.getLocation().getAbsoluteLocation().getAltitude();
                if (verticesByFloor.ContainsKey(floor))
                {
                    verticesByFloor[floor].Remove(v);
                }
            }
            return(true);
        }
예제 #2
0
	public bool removeVertex(Vertex v)
	{
		foreach (Edge e in v.incidentEdges())
			edges.Remove(e);
			
		//remove from <vertexId, vertex> structure
		vertices.Remove(v.getId());
		//remove from <floorNum, List<Vertex> structure
		bool hasLocation = v.getLocation() != null && v.getLocation().getAbsoluteLocation() != null;
		if (hasLocation)
		{
			int floor = (int)v.getLocation().getAbsoluteLocation().getAltitude();
			if (verticesByFloor.ContainsKey(floor))
			{
				verticesByFloor[floor].Remove(v);
			}
		}
		return true;
	}
예제 #3
0
 public IEnumerable <Edge> incidentEdges(Vertex v)
 {
     return(v.incidentEdges());
 }
예제 #4
0
	public IEnumerable<Edge> incidentEdges(Vertex v)
	{
		return v.incidentEdges();
	}