public void method_4(DrawingContext drawingContext_0, float float_0, float float_1, Map map_0)
        {
            SolidColorBrush lime = System.Windows.Media.Brushes.Lime;

            System.Windows.Media.Color cyan  = Colors.Cyan;
            System.Windows.Media.Brush brush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(60, cyan.R, cyan.G, cyan.B));
            foreach (KeyValuePair <string, ICollidable> keyValuePair in map_0.Collidables)
            {
                ICollidable value = keyValuePair.Value;
                if (value != null)
                {
                    CollidableSphere collidableSphere = keyValuePair.Value as CollidableSphere;
                    if (collidableSphere != null)
                    {
                        drawingContext_0.DrawEllipse(brush, null, new System.Windows.Point((double)(collidableSphere.Center.X * float_0), (double)(collidableSphere.Center.Y * float_1)), (double)((float)collidableSphere.Radius * float_0), (double)((float)collidableSphere.Radius * float_1));
                    }
                    else if (value.imethod_0(map_0) != CollidableType.None)
                    {
                        Rectangle rectangle = value.imethod_1();
                        if (rectangle.Y < 0)
                        {
                            rectangle.Height += rectangle.Y;
                            rectangle.Y       = 0;
                        }
                        if (rectangle.Bottom > map_0.MapSize.Height)
                        {
                            rectangle.Height -= rectangle.Bottom - map_0.MapSize.Height;
                        }
                        if (rectangle.Height >= 0 && rectangle.Width >= 0)
                        {
                            drawingContext_0.DrawRectangle(brush, null, new Rect((double)(float_0 * (float)rectangle.X), (double)(float_1 * (float)rectangle.Y), (double)((float)rectangle.Width * float_0), (double)((float)rectangle.Height * float_1)));
                        }
                    }
                }
            }
            PathSequence pathSequence = this.Context.Map.Grid.PathCache.method_2();

            if (pathSequence != null)
            {
                List <Vector2> path = pathSequence.Path;
                if (path.Count > 1)
                {
                    Vector2 vector = path.FirstOrDefault <Vector2>();
                    foreach (Vector2 vector2 in path)
                    {
                        if (!(vector2 == vector))
                        {
                            drawingContext_0.DrawLine(new System.Windows.Media.Pen(System.Windows.Media.Brushes.Red, 2.0), new System.Windows.Point((double)(vector.X * float_0), (double)(vector.Y * float_1)), new System.Windows.Point((double)(vector2.X * float_0), (double)(vector2.Y * float_1)));
                            vector = vector2;
                        }
                    }
                }
            }
        }
Example #2
0
    public override Vector2?vmethod_21(bool bool_3)
    {
        GClass855.< > c__DisplayClass9_0 CS$ < > 8__locals1 = new GClass855.< > c__DisplayClass9_0();
        CS$ < > 8__locals1.gclass855_0    = this;
        CS$ < > 8__locals1.vector2_0      = base.Hero.Position;
        CS$ < > 8__locals1.vector2_1      = (this.vmethod_41(CS$ < > 8__locals1.vector2_0, 2250) ?? this.vmethod_17()[0].smethod_4());
        CS$ < > 8__locals1.float_0        = Math.Min(Vector2.Distance(base.Hero.Position, CS$ < > 8__locals1.vector2_1) + 500f, 2500f);
        CS$ < > 8__locals1.pathSequence_0 = null;
        Map.Navigators.method_4(new Action <MapNavigator>(CS$ < > 8__locals1.method_0), 0);
        if (CS$ < > 8__locals1.pathSequence_0 != null)
        {
            base.Map.Grid.method_13(CS$ < > 8__locals1.pathSequence_0);
        }
        PathSequence pathSequence_ = CS$ < > 8__locals1.pathSequence_0;

        return(new Vector2?((pathSequence_ != null) ? pathSequence_.Destination : base.C.Game.Security.method_5(base.Map, this.vmethod_17())));
    }