Пример #1
0
 private void DrawCopters(Graphics g, ScreenConverter sc)
 {
     foreach (Quadrocopter q in QuadrocoptersList)
     {
         q.Draw(g, sc);
     }
 }
Пример #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);
        }
Пример #3
0
 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;
 }
Пример #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);
        }
Пример #5
0
 private void DrawMechanics(Graphics g, ScreenConverter sc)
 {
     GPSMechanic.Draw(g, sc);
     AirscrewMechanic.Draw(g, sc);
     LightsMechanic.Draw(g, sc);
 }
Пример #6
0
 public void DrawAll(Graphics g, ScreenConverter sc)
 {
     DrawOperators(g, sc);
     DrawMechanics(g, sc);
     DrawCopters(g, sc);
 }