Esempio n. 1
0
        /// <summary>
        /// Converts a Jet into Geometry
        /// </summary>
        /// <param name="value">The Jet to convert</param>
        /// <param name="targetType">The parameter is not used.</param>
        /// <param name="parameter">The parameter is not used.</param>
        /// <param name="culture">The parameter is not used.</param>
        /// <returns>Returns a Geometry containing the Jet</returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Jet jet = (Jet)value;
            RectangleGeometry jGeo = new RectangleGeometry(new Rect(jet.Position.X, jet.Position.Y, Jet.W, Jet.H));

            return(jGeo);
        }
Esempio n. 2
0
        /// <summary>
        /// Generates a new Jet
        /// </summary>
        /// <returns>Returns the Jet generated</returns>
        public Jet GenerateJet()
        {
            Jet jet;
            int startX  = 1;
            int targetX = (int)Math.Round(Cw - 2, 0);

            if (MainWindow.R.Next(0, 2) == 1)
            {
                startX  = targetX;
                targetX = 2;
            }

            Point start = new Point(startX, MainWindow.R.Next(1, (int)Math.Round(Ch * 0.2, 0)));

            jet = new Jet(start, targetX, GenerateEngine(false));

            return(jet);
        }