Skip to content

Commit

Permalink
Updated CSVs for Ultimatum.
Browse files Browse the repository at this point in the history
  • Loading branch information
ffhighwind committed Apr 18, 2021
1 parent 6ce6d9c commit 1588cd0
Show file tree
Hide file tree
Showing 4 changed files with 1,769 additions and 1,745 deletions.
14 changes: 7 additions & 7 deletions DataModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class DataModel
// http://api.poe.watch/get?league=Metamorph&category=armour
// http://api.poe.watch/compact?league=Metamorph&category=armour

private const string league = "Ritual";
private const string league = "Ultimatum";

private const string repoURL = @"https://raw.githubusercontent.com/ffhighwind/PoE-Price-Lister/master/";
public const string FiltersUrl = repoURL + @"Resources/Filters/";
Expand Down Expand Up @@ -253,15 +253,15 @@ private void LoadEnchantsCsv()
if (csvdata.Description[0] == '=')
csvdata.Description = csvdata.Description.Substring(1);
if (!SC.Enchantments.ContainsKey(csvdata.Description)) {
Enchantment scData = new Enchantment(csvdata.Name);
SC.Enchantments.Add(csvdata.Name, scData);
Enchantment scData = new Enchantment(csvdata.Enchantment);
SC.Enchantments.Add(csvdata.Enchantment, scData);
SC.EnchantmentsDescriptions.Add(csvdata.Description, scData);
Enchantment hcData = new Enchantment(csvdata.Name);
HC.Enchantments.Add(csvdata.Name, hcData);
Enchantment hcData = new Enchantment(csvdata.Enchantment);
HC.Enchantments.Add(csvdata.Enchantment, hcData);
HC.EnchantmentsDescriptions.Add(csvdata.Description, hcData);
}
SC.Enchantments[csvdata.Name].Load(csvdata);
HC.Enchantments[csvdata.Name].Load(csvdata);
SC.Enchantments[csvdata.Enchantment].Load(csvdata);
HC.Enchantments[csvdata.Enchantment].Load(csvdata);
}
}

Expand Down
29 changes: 16 additions & 13 deletions Enchants/EnchantCsv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,38 @@ namespace PoE_Price_Lister
[IgnoreEmptyLines]
public class EnchantCsv
{
[FieldQuoted('"', QuoteMode.OptionalForBoth, MultilineMode.AllowForRead)]
[FieldQuoted('"', QuoteMode.OptionalForBoth, MultilineMode.NotAllow)]
public string Item { get; set; }

[FieldQuoted('"', QuoteMode.OptionalForBoth, MultilineMode.AllowForRead)]
public string Name { get; set; }
[FieldQuoted('"', QuoteMode.OptionalForBoth, MultilineMode.NotAllow)]
public string Enchantment { get; set; }

[FieldConverter(typeof(DifficultyConverter))]
public EnchantmentSource Source { get; set; }

[FieldQuoted('"', QuoteMode.OptionalForBoth, MultilineMode.AllowForRead)]
[FieldQuoted('"', QuoteMode.OptionalForBoth, MultilineMode.NotAllow)]
public string Description { get; set; }

public string Gem { get; set; }

[FieldConverter(typeof(DifficultyConverter))]
public EnchantmentSource Source { get; set; }

//[FieldConverter(ConverterKind.PercentDouble)] // not working?
public string DropRate { get; set; }

internal class DifficultyConverter : ConverterBase
{
public override object StringToField(string from)
{
if (from.Equals("Eternal Labyrinth of Potential"))
if (from.Contains("Eternal Labyrinth of Potential"))
return EnchantmentSource.EternalLabyrinthOfPotential;
if (from.Equals("Merciless Labyrinth"))
if (from.Contains("Merciless Labyrinth"))
return EnchantmentSource.MercilessLab;
if (from.Equals("Eternal Labyrinth"))
if (from.Contains("Eternal Labyrinth"))
return EnchantmentSource.EternalLab;
if (from.Equals("Blight Oils"))
if (from.Contains("Blight Oils"))
return EnchantmentSource.BlightOils;
if (from.Equals("Cruel Labyrinth"))
if (from.Contains("Cruel Labyrinth"))
return EnchantmentSource.CruelLab;
if (from.Equals("Normal Labyrinth"))
if (from.Contains("Normal Labyrinth"))
return EnchantmentSource.NormalLab;
throw new InvalidOperationException(from);
}
Expand Down
2 changes: 1 addition & 1 deletion Enchants/Enchantment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Enchantment(string name)

public void Load(EnchantCsv csvdata)
{
Name = csvdata.Name;
Name = csvdata.Enchantment;
Description = csvdata.Description;
Source = csvdata.Source;
Gem = csvdata.Gem;
Expand Down
Loading

0 comments on commit 1588cd0

Please sign in to comment.