示例#1
0
 protected override void OnRender(DrawingContext drawingContext)
 {
     this.LastRender = DateTime.Now;
     drawingContext.DrawRectangle(System.Windows.Media.Brushes.Black, null, new Rect(0.0, 0.0, base.ActualWidth, base.ActualHeight));
     this.Progress.Visibility = Visibility.Collapsed;
     base.OnRender(drawingContext);
     if (base.DataContext != null && this.Map != null)
     {
         Map   map     = this.Map;
         float float_  = (float)base.ActualWidth / (float)map.MapSize.Width;
         float float_2 = (float)base.ActualHeight / (float)map.MapSize.Height;
         try
         {
             this.method_4(drawingContext, float_, float_2, this.Map);
         }
         catch
         {
         }
         this.method_5(drawingContext, float_, float_2, this.Map);
         string text = string.Join("\r\n", this.Context.method_68());
         if (!string.IsNullOrWhiteSpace(text))
         {
             this.Progress.Visibility = Visibility.Visible;
             this.Progress.Text       = (text ?? "");
         }
         foreach (KeyValuePair <int, Gate> keyValuePair in map.Gates)
         {
             this.method_9(drawingContext, float_, float_2, keyValuePair.Value);
         }
         foreach (KeyValuePair <string, Collectible> keyValuePair2 in map.Collectibles)
         {
             this.method_10(drawingContext, float_, float_2, keyValuePair2.Value);
         }
         foreach (KeyValuePair <int, Ship> keyValuePair3 in map.Ships)
         {
             Vector2 position = keyValuePair3.Value.Position;
             DarkorbitAPI.CommonStructures.Size mapSize = this.Map.MapSize;
             if (position.X <= (float)mapSize.Width && position.Y <= (float)mapSize.Height && position.X >= 0f && position.Y >= 0f)
             {
                 this.method_7(drawingContext, float_, float_2, keyValuePair3.Value);
             }
         }
         foreach (KeyValuePair <int, GroupManager.GroupMember> keyValuePair4 in this.Map.Hero.Group.Members)
         {
             this.method_8(drawingContext, float_, float_2, keyValuePair4.Value);
         }
         Vector2 position2 = this.Map.Hero.Position;
         DarkorbitAPI.CommonStructures.Size mapSize2 = this.Map.MapSize;
         bool flag;
         if (flag = (position2.X <= (float)mapSize2.Width && position2.Y <= (float)mapSize2.Height && position2.X >= 0f && position2.Y >= 0f))
         {
             this.method_6(drawingContext, float_, float_2, this.Map.Hero);
         }
         if (this.Context != null && flag)
         {
             this.method_11(drawingContext, float_, float_2, this.Context);
         }
         return;
     }
 }
示例#2
0
 private static EntityDataRoot smethod_15(Map map_0, float float_0, float float_1, params EntityRenderFragment[] args)
 {
     DarkorbitAPI.CommonStructures.Size mapSize = map_0.MapSize;
     return(new EntityDataRoot(float_0 / (float)mapSize.Width, float_1 / (float)mapSize.Height)
     {
         Data = new List <EntityRenderFragment>(args)
     });
 }
示例#3
0
        public void method_10()
        {
            object @lock = this._lock;

            lock (@lock)
            {
                this.method_11();
                this.Collidables = new HashSet <ICollidable>();
                DarkorbitAPI.CommonStructures.Size mapSize = this.Map.MapSize;
                this.Blocks = new byte[(this._bx = mapSize.Width / this.ScaleX) + 10, (this._by = mapSize.Height / this.ScaleY) + 10];
            }
        }
示例#4
0
    public static EntityDataRoot smethod_2(Map map_0, Entity entity_0)
    {
        DarkorbitAPI.CommonStructures.Size mapSize = map_0.MapSize;
        int num;
        int num2;
        int num3;
        int num4;
        int num5;

        entity_0.vmethod_0(out num, out num2, out num3, out num4, out num5);
        return(new EntityDataRoot((float)num / (float)mapSize.Width, (float)num2 / (float)mapSize.Height, (float)num3 / (float)mapSize.Width, (float)num4 / (float)mapSize.Height, (float)num5));
    }
示例#5
0
    private static EntityDataRoot smethod_22(Map map_0, CollidableRect collidableRect_0)
    {
        Rectangle rectangle = collidableRect_0.imethod_1();

        DarkorbitAPI.CommonStructures.Size mapSize = map_0.MapSize;
        Color cyan   = Color.Cyan;
        Color color_ = Color.FromArgb(60, (int)cyan.R, (int)cyan.G, (int)cyan.B);

        return(GClass840.smethod_15(map_0, (float)rectangle.X, (float)rectangle.Y, new EntityRenderFragment[]
        {
            GClass840.smethod_8(color_, (float)rectangle.Width / (float)mapSize.Width, (float)rectangle.Height / (float)mapSize.Height, null)
        }));
    }
示例#6
0
 public static Vector2 smethod_3(int int_0)
 {
     DarkorbitAPI.CommonStructures.Size size = MapUtils.smethod_1(int_0);
     return(new Vector2((float)size.Width / 2f, (float)size.Height / 2f));
 }
示例#7
0
 public static EntityDataRoot smethod_3(Map map_0, Vector2 vector2_0)
 {
     DarkorbitAPI.CommonStructures.Size mapSize = map_0.MapSize;
     return(new EntityDataRoot(vector2_0.X / (float)mapSize.Width, vector2_0.Y / (float)mapSize.Height));
 }