internal static FrameworkElement AircraftControlFactory(Aircraft aircraft, double scale) { IEnumerable <string> imageNames = CreateImageList(aircraft.AircraftType); AnimatedImage aircraftControl = new AnimatedImage(imageNames, TimeSpan.FromSeconds(.75)); aircraftControl.Width = aircraft.Size.Width * scale; aircraftControl.Height = aircraft.Size.Height * scale; SetCanvasLocation(aircraftControl, aircraft.Location.X * scale, aircraft.Location.Y * scale); return(aircraftControl); }
internal static FrameworkElement PlayerControlFactory(Player player, double scale) { AnimatedImage playerControl = new AnimatedImage(new List <string>() { "player.png", "player.png" }, TimeSpan.FromSeconds(1)); playerControl.Width = player.Size.Width * scale; playerControl.Height = player.Size.Height * scale; SetCanvasLocation(playerControl, player.Location.X * scale, player.Location.Y * scale); return(playerControl); }