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