Ejemplo n.º 1
0
 public abstract void Refresh(MapView m);
Ejemplo n.º 2
0
            protected void DoDraw(MapView m, Graphics graphics,
                IEnumerable<Prop> props, IEnumerable<Server.Objects.Object> objects)
            {
                if (m.DisplayProps)
                    foreach (Prop p in props)
                        graphics.DrawEllipse(Pens.Purple,
                            m.WorldToScreenX(p.position.X - p.MotionObject.Radius),
                            m.WorldToScreenY(p.position.Y - p.MotionObject.Radius),
                            m.SizeToScreenX(p.MotionObject.Radius * 2),
                            m.SizeToScreenY(p.MotionObject.Radius * 2));

                if (m.DisplayApparentSize)
                    foreach (Server.Objects.Object v in objects)
                        if (!v.IsDeleted)
                            graphics.DrawEllipse(Pens.Orange,
                                m.WorldToScreenX(v.Position.X - v.ObjectClass.VisibilityRange),
                                m.WorldToScreenY(v.Position.Y - v.ObjectClass.VisibilityRange),
                                m.SizeToScreenX(v.ObjectClass.VisibilityRange * 2),
                                m.SizeToScreenY(v.ObjectClass.VisibilityRange * 2));

                if (m.DisplaySightRange)
                    foreach (Server.Objects.Object v in objects)
                        if (!v.IsDeleted)
                            graphics.DrawEllipse(Pens.Blue,
                                m.WorldToScreenX(v.Position.X - v.ObjectClass.SightRange),
                                m.WorldToScreenY(v.Position.Y - v.ObjectClass.SightRange),
                                m.SizeToScreenX(v.ObjectClass.SightRange * 2),
                                m.SizeToScreenY(v.ObjectClass.SightRange * 2));

                foreach (Server.Objects.Object v in objects)
                    if (!v.IsDeleted)
                    {
                        Brush p = new SolidBrush(Common.Int2Color.Conv(v.Team));
                        graphics.FillEllipse(p,
                            m.WorldToScreenX(v.Position.X - v.ObjectClass.CollisionRadius),
                            m.WorldToScreenY(v.Position.Y - v.ObjectClass.CollisionRadius),
                            m.SizeToScreenX(v.ObjectClass.CollisionRadius * 2),
                            m.SizeToScreenY(v.ObjectClass.CollisionRadius * 2));
                    }

                Pen arrowp = new Pen(Color.Black, 1);
                arrowp.StartCap = System.Drawing.Drawing2D.LineCap.Flat;
                arrowp.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;

                foreach (Server.Objects.Object v in objects)
                    if (!v.IsDeleted)
                    {
                        arrowp.Color = Common.Int2Color.Conv(v.Team);
                        if (v is Server.Objects.Unit && ((Server.Objects.Unit)v).Target != null)
                            graphics.DrawLine(arrowp,
                                m.WorldToScreenX(v.Position.X),
                                m.WorldToScreenY(v.Position.Y),
                                m.WorldToScreenX(((Server.Objects.Unit)v).Target.Position.X),
                                m.WorldToScreenY(((Server.Objects.Unit)v).Target.Position.Y));
                    }

                foreach (Server.Objects.Object v in objects)
                    if (!v.IsDeleted)
                    {
                        graphics.DrawLine(Pens.Black,
                            m.WorldToScreenX(v.Position.X),
                            m.WorldToScreenY(v.Position.Y),
                            m.WorldToScreenX(v.Position.X + (float)Math.Cos(v.MotionObject.Orientation) * v.ObjectClass.CollisionRadius),
                            m.WorldToScreenY(v.Position.Y + (float)Math.Sin(v.MotionObject.Orientation) * v.ObjectClass.CollisionRadius));
                    }
            }
Ejemplo n.º 3
0
 public abstract void Draw(MapView m, Graphics graphics);
Ejemplo n.º 4
0
 public override void Refresh(MapView m)
 {
 }
Ejemplo n.º 5
0
 public override void Draw(MapView m, Graphics graphics)
 {
     DoDraw(m, graphics, MainWindow.Server.Props, MainWindow.Server.Objects.Values);
 }
Ejemplo n.º 6
0
 public override void Refresh(MapView m)
 {
     List<Server.Objects.Object> os = new List<Server.Objects.Object>();
     List<Prop> ps = new List<Prop>();
     os.AddRange(MainWindow.Server.VicinityManager.InVisibleRange(Following));
     os.Add(Following);
     ps.AddRange(MainWindow.Server.Props);
     m.objects = os;
     props = ps;
     m.Invalidate();
 }
Ejemplo n.º 7
0
 public override void Draw(MapView m, Graphics graphics)
 {
     DoDraw(m, graphics, props, m.objects);
 }