From 9566b4b062ad0f10832584c65457ef6505b097ab Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 3 Apr 2017 19:28:35 -0400 Subject: Categorize the Shiftorium --- ShiftOS_TheReturn/Shiftorium.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'ShiftOS_TheReturn/Shiftorium.cs') diff --git a/ShiftOS_TheReturn/Shiftorium.cs b/ShiftOS_TheReturn/Shiftorium.cs index 4556cd6..43ea13a 100644 --- a/ShiftOS_TheReturn/Shiftorium.cs +++ b/ShiftOS_TheReturn/Shiftorium.cs @@ -41,6 +41,27 @@ namespace ShiftOS.Engine /// public static bool Silent = false; + /// + /// Gets all Shiftorium categories. + /// + /// Should we look in the "available" upgrade list (i.e, what the user can buy right now), or the full upgrade list? + /// All Shiftorium categories from the list, in a . + public static string[] GetCategories(bool onlyAvailable = true) + { + List cats = new List(); + IEnumerable < ShiftoriumUpgrade > upgrades = GetDefaults(); + if (onlyAvailable) + upgrades = new List(GetAvailable()); + + foreach(var upg in upgrades) + { + if (!cats.Contains(upg.Category)) + cats.Add(upg.Category); + } + + return cats.ToArray(); + } + public static void InvokeUpgradeInstalled() { Installed?.Invoke(); @@ -289,6 +310,8 @@ namespace ShiftOS.Engine public string ID { get; private set; } } + + public class ShiftoriumUpgrade { public string Name { get; set; } -- cgit v1.2.3