public ApplicationVersion( ApplicationVersionType applicationVersionType, int major, int minor, int revision, int changeSet, ApplicationVersionGameType versionGameType) { this.ApplicationVersionType = applicationVersionType; this.Major = major; this.Minor = minor; this.Revision = revision; this.ChangeSet = changeSet; this.VersionGameType = versionGameType; }
/// <summary> /// e1.0.11 didn't had ChangeSet. /// It may be an overkill for such a minor game version, but why not. /// </summary> private static ApplicationVersion Create(ApplicationVersionType applicationVersionType, int major, int minor, int revision) { if (ApplicationVersionConstructorV1 != null) { return((ApplicationVersion)ApplicationVersionConstructorV1.Invoke(new object[] { applicationVersionType, major, minor, revision, 0 })); } if (ApplicationVersionConstructorV2 != null) { return((ApplicationVersion)ApplicationVersionConstructorV2.Invoke(new object[] { applicationVersionType, major, minor, revision })); } // Fallback var version = (ApplicationVersion)FormatterServices.GetUninitializedObject(typeof(ApplicationVersion)); ApplicationVersionTypeProperty?.SetValue(version, applicationVersionType); MajorProperty?.SetValue(version, major); MinorProperty?.SetValue(version, minor); RevisionProperty?.SetValue(version, revision); return(version); }
public static string GetPrefix(ApplicationVersionType applicationVersionType) { string str; switch (applicationVersionType) { case ApplicationVersionType.Alpha: str = "a"; break; case ApplicationVersionType.Beta: str = "b"; break; case ApplicationVersionType.EarlyAccess: str = "e"; break; case ApplicationVersionType.Release: str = "v"; break; case ApplicationVersionType.Development: str = "d"; break; case ApplicationVersionType.Multiplayer: str = "m"; break; default: str = "i"; break; } return(str); }