poe.watch api update

This commit is contained in:
mikx
2020-01-01 21:48:46 -05:00
parent 0f51517aaf
commit c921689116
7 changed files with 126 additions and 242 deletions

View File

@@ -8,69 +8,49 @@ using System.Threading.Tasks;
namespace PoE_MxFilterGen
{
public class SparklineAccessory
{
public List<double?> data { get; set; }
public double? totalChange { get; set; }
}
public class ExplicitModifierAccessory
{
public string text { get; set; }
public bool optional { get; set; }
}
public class LineAccessory
public class RootAccessory
{
public int id { get; set; }
public string name { get; set; }
public string type { get; set; }
public string category { get; set; }
public string group { get; set; }
public int frame { get; set; }
public List<object> influences { get; set; }
public string icon { get; set; }
public int mapTier { get; set; }
public int levelRequired { get; set; }
public string baseType { get; set; }
public int stackSize { get; set; }
public object variant { get; set; }
public object prophecyText { get; set; }
public object artFilename { get; set; }
public int links { get; set; }
public int itemClass { get; set; }
public SparklineAccessory sparkline { get; set; }
public List<object> implicitModifiers { get; set; }
public List<ExplicitModifierAccessory> explicitModifiers { get; set; }
public string flavourText { get; set; }
public string itemType { get; set; }
public double chaosValue { get; set; }
public double exaltedValue { get; set; }
public int count { get; set; }
}
public class RootAccessory
{
public List<LineAccessory> lines { get; set; }
public double mean { get; set; }
public double median { get; set; }
public double mode { get; set; }
public double min { get; set; }
public double max { get; set; }
public double exalted { get; set; }
public int total { get; set; }
public int daily { get; set; }
public int current { get; set; }
public int accepted { get; set; }
public double change { get; set; }
public List<object> history { get; set; }
public string variation { get; set; }
}
class Generator
{
private static string iB;
public static void Gen(string section, string api, string league, int minValue, int chanceMinValue, int confidence)
public static void Gen(string section, string api, string league, int minValue)
{
List<string> itemBase = new List<string>();
RootAccessory j = JsonConvert.DeserializeObject<RootAccessory>(File.ReadAllText("data/ninja.accessory.json", Encoding.UTF8));
var RootAccessory = JsonConvert.DeserializeObject<List<RootAccessory>>(File.ReadAllText("data/poew.accessory.json", Encoding.UTF8));
foreach (var ln in j.lines)
foreach (var ln in RootAccessory)
{
// Check if the item count is at least equal to the desired confidence level
if (ln.count >= confidence)
// Check if the item value is equal or superior to the minimum value
if (ln.min >= minValue)
{
// Check if the item value is equal or superior to the minimum value
if (ln.chaosValue >= minValue)
if (!itemBase.Contains(ln.type))
{
if (!itemBase.Contains(ln.baseType))
{
itemBase.Add(ln.baseType);
iB = iB + string.Format(@" ""{0}""", ln.baseType);
}
itemBase.Add(ln.type);
iB = iB + string.Format(@" ""{0}""", ln.type);
}
}
}
@@ -86,8 +66,8 @@ namespace PoE_MxFilterGen
File.AppendAllText(fn, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, @" CustomAlertSound ""mx_chase.mp3""", Encoding.UTF8);
File.AppendAllText(fn, " MinimapIcon 0 White Star", Encoding.UTF8);
File.AppendAllText(fn, @" CustomAlertSound ""mx_chase.mp3""" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, " PlayEffect White", Encoding.UTF8);
}
}