I need help with deserializing and editing this JSON:
{
"1":{
"id":1,
"constant":{
},
"common":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":199,
"min":1,
"max":1
},
{
"id":987,
"min":1,
"max":1
},
{
"id":985,
"min":1,
"max":1
}
]
},
"uncommon":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":205,
"min":1,
"max":1
},
{
"id":1249,
"min":1,
"max":1
}
]
},
"rare":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":215,
"min":1,
"max":1
},
{
"id":1201,
"min":1,
"max":1
},
{
"id":1149,
"min":1,
"max":1
}
]
},
"useRareTable":true
},
"2049":{
"id":2049,
"constant":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":592,
"min":1,
"max":1
}
]
},
"common":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":985,
"min":1,
"max":1
}
]
},
"uncommon":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":1197,
"min":1,
"max":1
},
{
"id":1249,
"min":1,
"max":1
}
]
},
"rare":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":1147,
"min":1,
"max":1
},
{
"id":1149,
"min":1,
"max":1
}
]
},
"useRareTable":true
},
"2":{
"id":2,
"constant":{
},
"common":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":5281,
"min":1,
"max":1
},
{
"id":985,
"min":1,
"max":1
}
]
},
"uncommon":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":5301,
"min":1,
"max":1
},
{
"id":1249,
"min":1,
"max":1
}
]
},
"rare":{
"scrolls":[
],
"charms":[
],
"drops":[
{
"id":5303,
"min":1,
"max":1
},
{
"id":1201,
"min":1,
"max":1
},
{
"id":1149,
"min":1,
"max":1
}
]
},
"useRareTable":true
}
}
Here are my classes:
public class types
{
public List<drops> scrolls { get; set; }
public List<drops> charms { get; set; }
public List<drops> drops { get; set; }
}
public class drops
{
public int id { get; set; }
public int min { get; set; }
public int max { get; set; }
}
public class Definition
{
public int Id { get; set; }
public List<types> constant { get; set; }
public List<types> common { get; set; }
public List<types> uncommon { get; set; }
public List<types> rare { get; set; }
public bool useRareTable { get; set; }
}
public class RootObject
{
public Dictionary<string, Definition> Definitions { get; set; }
}
I'm trying to create tool which will add each id in listbox. When I click on any index in listbox there should appear information. This id is monster id in game so every monster has own item drop list. After that I must be able to edit or add values and serialize it back to JSON.