public bool GetUpdate() { RiotSharp.RiotApi api = RiotSharp.RiotApi.GetInstance(VortexConfig.GetRiotApi()); RiotSharp.StaticRiotApi staticApi = RiotSharp.StaticRiotApi.GetInstance(VortexConfig.GetRiotApi()); RiotSharp.Region region = (RiotSharp.Region)Enum.Parse(typeof(RiotSharp.Region), VortexConfig.GetRegion()); RiotVersion RiotVersion = new RiotVersion( staticApi.GetVersions(region)[0] ); RiotVersion AppVersion = new RiotVersion( VortexConfig.GetRiotVersion()); if (RiotVersion > AppVersion) { return false; } if (RiotVersion.Comparer(AppVersion) == 1) { } return false; }
public int Comparer(RiotVersion compareVersion) { if (this.Season == compareVersion.Season && this.Update == compareVersion.Update && this.Tier == compareVersion.Tier) { return 0; } if (this.Season < compareVersion.Season) { return -1; } else if (this.Season > compareVersion.Season) { return 1; } else { if (this.Tier < compareVersion.Tier) { return -1; } else { return 1; } } }