| | |
| | | |
| | | } |
| | | |
| | | public bool HasPropertyType(int propertyId) |
| | | { |
| | | return equipLegendPropertyColors.ContainsKey(propertyId); |
| | | } |
| | | |
| | | public LegendAttrType GetPropertyType(int propertyId) |
| | | { |
| | | if (equipLegendPropertyColors.ContainsKey(propertyId)) |
| | | if (HasPropertyType(propertyId)) |
| | | { |
| | | return equipLegendPropertyColors[propertyId]; |
| | | } |
| | |
| | | |
| | | public class LegendPropertyCount |
| | | { |
| | | Dictionary<> |
| | | Dictionary<int, StarLegendPropertyCount> qualityToStarLegendPropertyCounts = new Dictionary<int, StarLegendPropertyCount>(); |
| | | |
| | | public LegendPropertyCount(string configId) |
| | | { |
| | | var config = FuncConfigConfig.Get(configId); |
| | | var json = JsonMapper.ToObject(config.Numerical1); |
| | | foreach (var key in json.Keys) |
| | | { |
| | | var quality = int.Parse(key); |
| | | qualityToStarLegendPropertyCounts[quality] = new StarLegendPropertyCount(json[key]); |
| | | } |
| | | } |
| | | |
| | | class StarLegendPropertyCount |
| | | { |
| | | Dictionary<LegendAttrType, int> counts = new Dictionary<LegendAttrType, int>(); |
| | | Dictionary<int, Dictionary<LegendAttrType, int>> counts = new Dictionary<int, Dictionary<LegendAttrType, int>>(); |
| | | |
| | | public StarLegendPropertyCount(JsonData json) |
| | | { |
| | | |
| | | foreach (var key in json.Keys) |
| | | { |
| | | var star = int.Parse(key); |
| | | var typeCounts = counts[star] = new Dictionary<LegendAttrType, int>(); |
| | | var subJson = json[key]; |
| | | foreach (var item in subJson.Keys) |
| | | { |
| | | var type = (LegendAttrType)(int.Parse(item)); |
| | | typeCounts[type] = (int)subJson[item]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |