Filtration/Filtration/Services/StaticDataService.cs
Glen M 7ce5aaa861 Support for Path of Exile 3.5 and Betrayal league. (#108)
* Fix #107 by pulling SortOrder form an enum.
* Add initial support for the Prophecy block item.
* Update the static data.
* Hook Prophecy data into the static data service.
* Fill out the initial prophecy data.
2018-12-05 06:59:10 +00:00

41 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.IO;
using System.Linq;
using Filtration.Common.Utilities;
using Filtration.Properties;
namespace Filtration.Services
{
public interface IStaticDataService
{
IEnumerable<string> ItemBaseTypes { get; }
IEnumerable<string> ItemClasses { get; }
IEnumerable<string> ItemMods { get; }
IEnumerable<string> Prophecies { get; }
}
internal class StaticDataService : IStaticDataService
{
public StaticDataService()
{
PopulateStaticData();
}
public IEnumerable<string> ItemBaseTypes { get; private set; }
public IEnumerable<string> ItemClasses { get; private set; }
public IEnumerable<string> ItemMods { get; private set; }
public IEnumerable<string> Prophecies { get; private set; }
private void PopulateStaticData()
{
ItemBaseTypes = new LineReader(() => new StringReader(Resources.ItemBaseTypes)).ToList();
ItemClasses = new LineReader(() => new StringReader(Resources.ItemClasses)).ToList();
ItemMods = new LineReader(() => new StringReader(Resources.ItemMods)).ToList();
Prophecies = new LineReader(() => new StringReader(Resources.Prophecies)).ToList();
}
}
}