Exemplo n.º 1
0
        /// <summary>
        /// Redraw all objects on Canvas
        /// </summary>
        public static void RedrawAllObjects(Canvas canvas)
        {
            //clear canvas
            canvas.Children.Clear();

            //draw roads
            foreach (var road in Roads)
            {
                RoadCreator.DrawRoad(canvas, road);
            }

            //draw Buildings
            foreach (var building in Buildings)
            {
                BuildingCreator.DrawBuilding(canvas, building);
            }

            //draw Garages
            foreach (var garage in Garages)
            {
                GarageCreator.drawGarage(canvas, garage);
            }

            // check for unnessesary intersection if so remove or nessesary
            IntersectionCreator.UpdateIntersections(Roads, Intersections);

            //draw Intersection
            foreach (var intersection in Intersections)
            {
                IntersectionCreator.DrawIntersection(canvas, intersection);
            }
        }