Exemple #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));
        }
 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);
 }
 public static string GetJson(JsonItem[] items)
 {
     JsonSerializerSettings settings = new JsonSerializerSettings();
     settings.DefaultValueHandling = DefaultValueHandling.Ignore;
     return JsonConvert.SerializeObject(new JsonItemList
     {
         items = items
     }, settings);
 }
 public Backpack(IContainer parent, Item[] items, ItemData[] datas, JsonItem bag)
     : base(parent, items, datas)
 {
     this.Size = items.Length;
     this.Bag = bag;
 }
 public Backpack(IContainer parent, int size, JsonItem bag)
     : this(parent, new Item[size], new ItemData[size], bag)
 {
 }