Class ReleaseVersion
Namespace: Void.Minecraft
Assembly: Void.Minecraft.dll
Represents a Minecraft release version number in Major.Minor[.Patch] form.
public record ReleaseVersion : IComparable<ReleaseVersion>, IEquatable<ReleaseVersion>Inheritance
Implements
IComparable<ReleaseVersion>, IEquatable<ReleaseVersion>
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
Patch is optional: when it is 0, "1.21"). A non-zero patch produces the three-component form (for example,
"1.21.4").
Ordering follows the natural numeric ordering of the components: Major first, then Minor, then Patch.
Implicit conversions are provided in both directions so that a
Constructors
ReleaseVersion(ushort, ushort, ushort)
Represents a Minecraft release version number in Major.Minor[.Patch] form.
public ReleaseVersion(ushort Major, ushort Minor, ushort Patch)Parameters
Major ushort
The major component of the version number (for example, 1 in 1.21.4).
Minor ushort
The minor component of the version number (for example, 21 in 1.21.4).
Patch ushort
The patch component of the version number (for example, 4 in 1.21.4). Pass 0 for releases that have no patch segment.
Remarks
Patch is optional: when it is 0, "1.21"). A non-zero patch produces the three-component form (for example,
"1.21.4").
Ordering follows the natural numeric ordering of the components: Major first, then Minor, then Patch.
Implicit conversions are provided in both directions so that a
Properties
Major
The major component of the version number (for example, 1 in 1.21.4).
public ushort Major { get; init; }Property Value
Minor
The minor component of the version number (for example, 21 in 1.21.4).
public ushort Minor { get; init; }Property Value
Patch
The patch component of the version number (for example, 4 in 1.21.4). Pass 0 for releases that have no patch segment.
public ushort Patch { get; init; }Property Value
Methods
CompareTo(ReleaseVersion?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(ReleaseVersion? other)Parameters
other ReleaseVersion?
An object to compare with this instance.
Returns
A value that indicates the relative order of the objects being compared. The return value has these meanings:
| Value | Meaning |
|---|---|
| Less than zero | This instance precedes other in the sort order. |
| Zero | This instance occurs in the same position in the sort order as other. |
| Greater than zero | This instance follows other in the sort order. |
Parse(string)
public static ReleaseVersion Parse(string versionString)Parameters
versionString string
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()Returns
A string that represents the current object.
TryParse(string, out ReleaseVersion)
public static bool TryParse(string versionString, out ReleaseVersion version)Parameters
versionString string
version ReleaseVersion
Returns
Operators
implicit operator ReleaseVersion(string)
public static implicit operator ReleaseVersion(string versionString)Parameters
versionString string
Returns
implicit operator string(ReleaseVersion)
public static implicit operator string(ReleaseVersion version)Parameters
version ReleaseVersion