Example #1
0
        public static string GetJson(Item[] items, ItemData[] datas)
        {
            var jsItems = new JsonItem[items.Length];

            for (int i = 0; i < items.Length; i++)
            {
                if (items[i] != null)
                {
                    jsItems[i] = new JsonItem(items[i], datas[i]);
                }
                else
                {
                    jsItems[i] = null;
                }
            }
            return(GetJson(jsItems));
        }
Example #2
0
 public static string GetJson(Item[] items, ItemData[] datas)
 {
     var jsItems = new JsonItem[items.Length];
     for (int i = 0; i < items.Length; i++)
         if (items[i] != null)
             jsItems[i] = new JsonItem(items[i], datas[i]);
         else
             jsItems[i] = null;
     return GetJson(jsItems);
 }
Example #3
0
 public static string GetJson(JsonItem[] items)
 {
     JsonSerializerSettings settings = new JsonSerializerSettings();
     settings.DefaultValueHandling = DefaultValueHandling.Ignore;
     return JsonConvert.SerializeObject(new JsonItemList
     {
         items = items
     }, settings);
 }
Example #4
0
 public Backpack(IContainer parent, Item[] items, ItemData[] datas, JsonItem bag)
     : base(parent, items, datas)
 {
     this.Size = items.Length;
     this.Bag = bag;
 }
Example #5
0
 public Backpack(IContainer parent, int size, JsonItem bag)
     : this(parent, new Item[size], new ItemData[size], bag)
 {
 }