Simulator/src/model/map/Map.java
/**
	 * Updates the dimensions of the map.
	 */
Updates the dimensions of the map.
Updates the dimensions of the map .
private void updateDimensions() {
		double tempWidth = 0;
		double tempHeight = 0;
		for (PhysicalMapComponent mapComponent : getMapComponents(PhysicalMapComponent.class)) {
			if (mapComponent instanceof CircularMapComponent) {
				double tempX = mapComponent.position.x + ((CircularMapComponent) mapComponent).getRadius();
				double tempY = mapComponent.position.y + ((CircularMapComponent) mapComponent).getRadius();
				if (tempX > tempWidth)
					tempWidth = tempX;
				if (tempY > tempHeight)
					tempHeight = tempY;
			} else if (mapComponent instanceof PolygonMapComponent) {
				List<Position> corners = ((PolygonMapComponent) mapComponent).getCorners();
				double tempX = 0;
				double tempY = 0;
				for (Position corner : corners) {
					if (corner.x > tempX)
						tempX = corner.x;
					if (corner.y > tempY)
						tempY = corner.y;
				}
				if (tempX > tempWidth)
					tempWidth = tempX;
				if (tempY > tempHeight)
					tempHeight = tempY;
			}
		}
		if (tempWidth + 1 >= minimumWidth)
			width = Math.round(tempWidth + 1);
		if (tempHeight + 1 >= minimumHeight)
			height = Math.round(tempHeight + 1);
	}
private void updateDimensions ( ) { double tempWidth = 0 ; double tempHeight = 0 ; for ( PhysicalMapComponent mapComponent : getMapComponents ( PhysicalMapComponent . class ) ) { if ( mapComponent instanceof CircularMapComponent ) { double tempX = mapComponent . position . x + ( ( CircularMapComponent ) mapComponent ) . getRadius ( ) ; double tempY = mapComponent . position . y + ( ( CircularMapComponent ) mapComponent ) . getRadius ( ) ; if ( tempX > tempWidth ) tempWidth = tempX ; if ( tempY > tempHeight ) tempHeight = tempY ; } else if ( mapComponent instanceof PolygonMapComponent ) { List < Position > corners = ( ( PolygonMapComponent ) mapComponent ) . getCorners ( ) ; double tempX = 0 ; double tempY = 0 ; for ( Position corner : corners ) { if ( corner . x > tempX ) tempX = corner . x ; if ( corner . y > tempY ) tempY = corner . y ; } if ( tempX > tempWidth ) tempWidth = tempX ; if ( tempY > tempHeight ) tempHeight = tempY ; } } if ( tempWidth + 1 >= minimumWidth ) width = Math . round ( tempWidth + 1 ) ; if ( tempHeight + 1 >= minimumHeight ) height = Math . round ( tempHeight + 1 ) ; }
Updates the dimensions of the map.
Updates the dimensions of the map .