aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Shiftorium.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-03 18:36:13 -0400
committerMichael <[email protected]>2017-04-03 18:36:13 -0400
commitf43f6fe17d054f83c686b552201d6b4bfc83524d (patch)
treeb66ca011496569fc99df3fbe53bfc5d212557bab /ShiftOS_TheReturn/Shiftorium.cs
parent29a88a5c46dff19358b44defdc52bb75db12b9ad (diff)
downloadshiftos_thereturn-f43f6fe17d054f83c686b552201d6b4bfc83524d.tar.gz
shiftos_thereturn-f43f6fe17d054f83c686b552201d6b4bfc83524d.tar.bz2
shiftos_thereturn-f43f6fe17d054f83c686b552201d6b4bfc83524d.zip
LOADS of optimizations and Pong fixes.
Diffstat (limited to 'ShiftOS_TheReturn/Shiftorium.cs')
-rw-r--r--ShiftOS_TheReturn/Shiftorium.cs28
1 files changed, 26 insertions, 2 deletions
diff --git a/ShiftOS_TheReturn/Shiftorium.cs b/ShiftOS_TheReturn/Shiftorium.cs
index 0bdd9f4..4556cd6 100644
--- a/ShiftOS_TheReturn/Shiftorium.cs
+++ b/ShiftOS_TheReturn/Shiftorium.cs
@@ -46,6 +46,23 @@ namespace ShiftOS.Engine
Installed?.Invoke();
}
+ public static string GetCategory(string id)
+ {
+ var upg = GetDefaults().FirstOrDefault(x => x.ID == id);
+ if (upg == null)
+ return "Other";
+ return (upg.Category == null) ? "Other" : upg.Category;
+ }
+
+ public static IEnumerable<ShiftoriumUpgrade> GetAllInCategory(string cat)
+ {
+ return GetDefaults().Where(x => x.Category == cat);
+ }
+
+ public static bool IsCategoryEmptied(string cat)
+ {
+ return GetDefaults().Where(x => x.Category == cat).FirstOrDefault(x => x.Installed == false) == null;
+ }
public static bool Buy(string id, int cost)
{
@@ -278,8 +295,15 @@ namespace ShiftOS.Engine
public string Description { get; set; }
public int Cost { get; set; }
public string ID { get { return (this.Id != null ? this.Id : (Name.ToLower().Replace(" ", "_"))); } }
- public string Id { get; }
-
+ public string Id { get; set; }
+ public string Category { get; set; }
+ public bool Installed
+ {
+ get
+ {
+ return Shiftorium.UpgradeInstalled(ID);
+ }
+ }
public string Dependencies { get; set; }
}
}