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

40 lines
1.4 KiB
C#

using System.Linq;
using System.Windows.Media;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.BlockItemTypes
{
public class ProphecyBlockItem : StringListBlockItem
{
public override string PrefixText => "Prophecy";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Prophecy";
public override string SummaryText
{
get
{
if (Items.Count > 0 && Items.Count < 4)
{
return "Prophecies: " +
Items.Aggregate(string.Empty, (current, i) => current + i + ", ").TrimEnd(' ').TrimEnd(',');
}
if (Items.Count >= 4)
{
var remaining = Items.Count - 3;
return "Prophecies: " + Items.Take(3)
.Aggregate(string.Empty, (current, i) => current + i + ", ")
.TrimEnd(' ')
.TrimEnd(',') + " (+" + remaining + " more)";
}
return "Prophecies: (none)";
}
}
public override Color SummaryBackgroundColor => Colors.DarkMagenta;
public override Color SummaryTextColor => Colors.White;
public override BlockItemOrdering SortOrder => BlockItemOrdering.Prophecy;
}
}