diff options
| author | Michael <[email protected]> | 2017-04-03 18:36:13 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-04-03 18:36:13 -0400 |
| commit | f43f6fe17d054f83c686b552201d6b4bfc83524d (patch) | |
| tree | b66ca011496569fc99df3fbe53bfc5d212557bab /ShiftOS_TheReturn | |
| parent | 29a88a5c46dff19358b44defdc52bb75db12b9ad (diff) | |
| download | shiftos_thereturn-f43f6fe17d054f83c686b552201d6b4bfc83524d.tar.gz shiftos_thereturn-f43f6fe17d054f83c686b552201d6b4bfc83524d.tar.bz2 shiftos_thereturn-f43f6fe17d054f83c686b552201d6b4bfc83524d.zip | |
LOADS of optimizations and Pong fixes.
Diffstat (limited to 'ShiftOS_TheReturn')
| -rw-r--r-- | ShiftOS_TheReturn/Shiftorium.cs | 28 |
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; } } } |
