Skip to main content

ModVersion

A struct in TavernLib, TavernLib.Backend.Mods.

A mod version, exactly MAJOR.MINOR.PATCH in ASCII digits with no pre-release or build parts, compared by major, minor, then patch.

Constructors​

MemberWhat it is
ModVersion(int major, int minor, int patch)Creates a version from major, minor and patch numbers.

Properties​

MemberWhat it is
int Major { get; }The first number.
int Minor { get; }The second number.
int Patch { get; }The third number.

Methods​

MemberWhat it is
int CompareTo(ModVersion other)Compares by major, then minor, then patch.
static bool op_GreaterThan(ModVersion a, ModVersion b)Compares two versions.
static bool op_GreaterThanOrEqual(ModVersion a, ModVersion b)Compares two versions.
static bool op_LessThan(ModVersion a, ModVersion b)Compares two versions.
static bool op_LessThanOrEqual(ModVersion a, ModVersion b)Compares two versions.
static ModVersion Parse(string v)Parses three dot-separated digit runs after trimming spaces. Throws ModManagerException for anything else.
override string ToString()The version as major.minor.patch.
static bool TryParse(string v, out ModVersion result)The same as Parse, returning false instead of throwing.
1 private and internal method
MemberWhat it is
private static int Segment(string v, string part)Parses one version segment, accepting ASCII digits only and throwing on anything else or on overflow.

Used in​

Members of other types that take, return or hold a ModVersion: