Exemplo n.º 1
0
 public void UpdateandDraw(System.Drawing.Graphics g, UniverseDisplaySettings us)
 {
     foreach (Entity e in Entities)
     {
         e.Update(ref AddEntityList, Map, ref tempmap);
         e.Draw(g, us);
     }
     //clense map
     CleneseMap();
 }
Exemplo n.º 2
0
 public void Draw(System.Drawing.Graphics g, UniverseDisplaySettings us)
 {
     foreach (Entity e in Entities)
     {
         e.Draw(g, us);
     }
     if (us.DebugHeatSignatures)
     {
         foreach (HeatSignature h in Map.HeatMap)
         {
             g.DrawEllipse(Pens.Orange, h.Location.X, h.Location.Y, 1, 1);
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Draws the plane
        /// </summary>
        /// <param name="g">The graphics object to use</param>
        public override void Draw(Graphics g, UniverseDisplaySettings us)
        {
            Pen gp = new Pen(TeamColor);

            //draw plane's image
            g.DrawImage(Properties.Resources.plane.Rotate(Orientation), new RectangleF(Location.CenterPoint(new Size(20, 20)), new Size(20, 20)));
            //highlight if selected
            if (isSelected)
            {
                if (us.HighightSelectedPlane)
                {
                    g.DrawEllipse(Pens.Yellow, new RectangleF(Location.CenterPoint(new Size(20, 20)), new Size(20, 20)));
                }
                //draw gunsight
                g.DrawLine(gp, Location.CreateHitTriangle(Radar.gunRange, Orientation, 5)[2], Location.CreateHitTriangle(Radar.gunRange, Orientation, 5)[1]);
                //draw radar ranges
                //short ir
                g.DrawPolygon(gp, Location.CreateHitTriangle(Radar.SRInfaredRange, Orientation, Radar.SRInfaredSightAngle));
                //short
                g.DrawPolygon(gp, Location.CreateHitTriangle(Radar.SRRadarRange, Orientation, Radar.SRRadarSightAngle));
                //medium
                g.DrawPolygon(gp, Location.CreateHitTriangle(Radar.MRRadarRange, Orientation, Radar.MRRadarSightAngle));
                //radar zone
                Pen p1 = new Pen(TeamColor);
                p1.DashPattern = new float[] { 5f, 20f, 1f, 20f };
                g.DrawEllipse(p1, new RectangleF(Location.CenterPoint(new SizeF(Radar.LRRadarRange, Radar.LRRadarRange)), new SizeF(Radar.LRRadarRange, Radar.LRRadarRange)));
                //draw projected travel
                p1.DashPattern = new float[] { 5f, 10f };
                g.DrawLine(p1, Location, Destination);
                //draw destination as circle
                g.DrawEllipse(gp, new RectangleF(Destination.CenterPoint(new Size(5, 5)), new Size(5, 5)));
                //draw guardpoint as circle
                if (AITarget.Mode == TargetMode.Guard || AITarget.Mode == TargetMode.GuardToPursue)
                {
                    //draw center point
                    g.DrawEllipse(gp, new RectangleF(AITarget.GuardPoint.CenterPoint(new Size(5, 5)), new Size(5, 5)));
                    //draw radius
                    g.DrawEllipse(p1, new RectangleF(AITarget.GuardPoint.CenterPoint(new SizeF(AITarget.GuardAreaRadius * 2, AITarget.GuardAreaRadius * 2)), new SizeF(AITarget.GuardAreaRadius * 2, AITarget.GuardAreaRadius * 2)));
                }
                //draw trail
                Pen p = new Pen(TeamColor);
                p.LineJoin    = System.Drawing.Drawing2D.LineJoin.Round;
                p.DashPattern = new float[] { 1f, 5f };
                g.DrawLines(gp, TrailPoints);
            }
            else
            {
                //draw gunsight
                if (us.AllGunSight)
                {
                    g.DrawLine(gp, Location.CreateHitTriangle(Radar.gunRange, Orientation, 5)[2], Location.CreateHitTriangle(Radar.gunRange, Orientation, 5)[1]);
                }
                //draw radar ranges
                //short ir
                if (us.AlllIRRadar)
                {
                    g.DrawPolygon(gp, Location.CreateHitTriangle(Radar.SRInfaredRange, Orientation, Radar.SRInfaredSightAngle));
                }
                //short
                if (us.AllSRRadar)
                {
                    g.DrawPolygon(gp, Location.CreateHitTriangle(Radar.SRRadarRange, Orientation, Radar.SRRadarSightAngle));
                }
                //medium
                if (us.AllMRRadar)
                {
                    g.DrawPolygon(gp, Location.CreateHitTriangle(Radar.MRRadarRange, Orientation, Radar.MRRadarSightAngle));
                }
                //radar zone
                Pen p1 = new Pen(TeamColor);
                p1.DashPattern = new float[] { 5f, 20f, 1f, 20f };
                if (us.AllLRRadar)
                {
                    g.DrawEllipse(p1, new RectangleF(Location.CenterPoint(new SizeF(Radar.LRRadarRange, Radar.LRRadarRange)), new SizeF(Radar.LRRadarRange, Radar.LRRadarRange)));
                }
                //draw projected travel
                p1.DashPattern = new float[] { 5f, 10f };
                if (us.AllDestination)
                {
                    g.DrawLine(p1, Location, Destination);
                    //draw destination as circle
                    g.DrawEllipse(gp, new RectangleF(Destination.CenterPoint(new Size(5, 5)), new Size(5, 5)));
                }
                //draw guardpoint as circle
                if (us.AllGuardZone)
                {
                    if (AITarget.Mode == TargetMode.Guard || AITarget.Mode == TargetMode.GuardToPursue)
                    {
                        //draw center point
                        g.DrawEllipse(gp, new RectangleF(AITarget.GuardPoint.CenterPoint(new Size(5, 5)), new Size(5, 5)));
                        //draw radius
                        g.DrawEllipse(p1, new RectangleF(AITarget.GuardPoint.CenterPoint(new SizeF(AITarget.GuardAreaRadius * 2, AITarget.GuardAreaRadius * 2)), new SizeF(AITarget.GuardAreaRadius * 2, AITarget.GuardAreaRadius * 2)));
                    }
                }
                //draw trail
                Pen p = new Pen(TeamColor);
                p.LineJoin    = System.Drawing.Drawing2D.LineJoin.Round;
                p.DashPattern = new float[] { 1f, 5f };
                if (us.AllTrail)
                {
                    g.DrawLines(gp, TrailPoints);
                }
            }
        }
Exemplo n.º 4
0
 public virtual void Draw(Graphics g, UniverseDisplaySettings us)
 {
 }
Exemplo n.º 5
0
 public override void Draw(Graphics g, UniverseDisplaySettings us)
 {
     g.DrawImage(Properties.Resources.missile.Rotate(Orientation), new RectangleF(Location.CenterPoint(new Size(20, 00)), new Size(20, 20)));
 }