aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Shiftorium.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-03 19:28:35 -0400
committerMichael <[email protected]>2017-04-03 19:28:35 -0400
commit9566b4b062ad0f10832584c65457ef6505b097ab (patch)
tree20a11842ea6e71b26941624af7f50f4ed29cdf19 /ShiftOS_TheReturn/Shiftorium.cs
parentf43f6fe17d054f83c686b552201d6b4bfc83524d (diff)
downloadshiftos_thereturn-9566b4b062ad0f10832584c65457ef6505b097ab.tar.gz
shiftos_thereturn-9566b4b062ad0f10832584c65457ef6505b097ab.tar.bz2
shiftos_thereturn-9566b4b062ad0f10832584c65457ef6505b097ab.zip
Categorize the Shiftorium
Diffstat (limited to 'ShiftOS_TheReturn/Shiftorium.cs')
-rw-r--r--ShiftOS_TheReturn/Shiftorium.cs23
1 files changed, 23 insertions, 0 deletions
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
/// </summary>
public static bool Silent = false;
+ /// <summary>
+ /// Gets all Shiftorium categories.
+ /// </summary>
+ /// <param name="onlyAvailable">Should we look in the "available" upgrade list (i.e, what the user can buy right now), or the full upgrade list?</param>
+ /// <returns>All Shiftorium categories from the list, in a <see cref="System.String[]"/>. </returns>
+ public static string[] GetCategories(bool onlyAvailable = true)
+ {
+ List<string> cats = new List<string>();
+ IEnumerable < ShiftoriumUpgrade > upgrades = GetDefaults();
+ if (onlyAvailable)
+ upgrades = new List<ShiftoriumUpgrade>(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; }