Example #1
0
 private void DrawCopters(Graphics g, ScreenConverter sc)
 {
     foreach (Quadrocopter q in QuadrocoptersList)
     {
         q.Draw(g, sc);
     }
 }
Example #2
0
        public void Draw(Graphics g, ScreenConverter sc)
        {
            Point p = sc.R2S(Position);

            g.DrawImage(Properties.Resources._operator, p);
            g.DrawString(Quadrocopter.Number.ToString(), new Font(FontFamily.GenericMonospace, 10), Brushes.Black, p.X + 20, p.Y + 25);
        }
 public Quadrocopters()
 {
     InitializeComponent();
     w  = new World(new SizeF(pictureBox1.Width, pictureBox1.Height));
     sc = new ScreenConverter(new Size(pictureBox1.Width, pictureBox1.Height),
                              new RectangleF(0, w.Height, w.Width, w.Height));
     drawTimer.Start();
     Thread.CurrentThread.Priority = ThreadPriority.Highest;
 }
Example #4
0
        public void Draw(Graphics g, ScreenConverter sc)
        {
            Point p = sc.R2S(Position);

            g.DrawImage(Properties.Resources.copter, p);
            Color c = Color.Black;

            if (Lights)
            {
                switch (State)
                {
                case State.Waiting:
                {
                    c = Color.Blue;
                }
                break;

                case State.OK:
                {
                    c = Color.FromArgb(0, 255, 0);
                }
                break;

                case State.Crashed:
                {
                    c = Color.Red;
                }
                break;

                default:
                {
                    c = Color.Pink;
                }
                break;
                }
            }
            g.FillEllipse(new SolidBrush(c), p.X + 44, p.Y + 25, 10, 10);
            g.DrawString(Number.ToString(), new Font(FontFamily.GenericMonospace, 10), Brushes.Black, p.X + 44, p.Y + 10);
        }
Example #5
0
 private void DrawMechanics(Graphics g, ScreenConverter sc)
 {
     GPSMechanic.Draw(g, sc);
     AirscrewMechanic.Draw(g, sc);
     LightsMechanic.Draw(g, sc);
 }
Example #6
0
 public void DrawAll(Graphics g, ScreenConverter sc)
 {
     DrawOperators(g, sc);
     DrawMechanics(g, sc);
     DrawCopters(g, sc);
 }