> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md).

# Struct ksVersion

Namespace: [KS.Reactor.Client](/reactor/api-reference/ks.reactor.client.md)\
Assembly: KSUnity.dll

Version number consisting of major, minor, revision, and build.

```csharp
public struct ksVersion
```

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### ksVersion(uint, uint, uint) <a href="#ks_reactor_client_ksversion__ctor_system_uint32_system_uint32_system_uint32" id="ks_reactor_client_ksversion__ctor_system_uint32_system_uint32_system_uint32"></a>

Constructor

```csharp
public ksVersion(uint major, uint minor, uint revision)
```

#### Parameters

`major` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

major number

`minor` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

minor number

`revision` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

revision number

### ksVersion(uint, uint, uint, uint) <a href="#ks_reactor_client_ksversion__ctor_system_uint32_system_uint32_system_uint32_system_uint32" id="ks_reactor_client_ksversion__ctor_system_uint32_system_uint32_system_uint32_system_uint32"></a>

Constructor

```csharp
public ksVersion(uint major, uint minor, uint revision, uint build)
```

#### Parameters

`major` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

major number

`minor` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

minor number

`revision` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

revision number

`build` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

build number

### ksVersion(uint, uint, uint, string, uint) <a href="#ks_reactor_client_ksversion__ctor_system_uint32_system_uint32_system_uint32_system_string_system_uin" id="ks_reactor_client_ksversion__ctor_system_uint32_system_uint32_system_uint32_system_string_system_uin"></a>

Constructor

```csharp
public ksVersion(uint major, uint minor, uint revision, string prerelease, uint build)
```

#### Parameters

`major` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

major number

`minor` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

minor number

`revision` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

revision number

`prerelease` [string](https://learn.microsoft.com/dotnet/api/system.string)

prerelease string

`build` [uint](https://learn.microsoft.com/dotnet/api/system.uint32)

build number

## Properties

### Build <a href="#ks_reactor_client_ksversion_build" id="ks_reactor_client_ksversion_build"></a>

Build number

```csharp
public uint Build { get; }
```

#### Property Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### Current <a href="#ks_reactor_client_ksversion_current" id="ks_reactor_client_ksversion_current"></a>

```csharp
[Obsolete("Use ksReactor.Version instead.")]
public static ksVersion Current { get; set; }
```

#### Property Value

[ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

### Major <a href="#ks_reactor_client_ksversion_major" id="ks_reactor_client_ksversion_major"></a>

Major number

```csharp
public uint Major { get; }
```

#### Property Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### Minor <a href="#ks_reactor_client_ksversion_minor" id="ks_reactor_client_ksversion_minor"></a>

Minor number

```csharp
public uint Minor { get; }
```

#### Property Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### Prerelease <a href="#ks_reactor_client_ksversion_prerelease" id="ks_reactor_client_ksversion_prerelease"></a>

Prerelease string. Empty string for non-prerelease versions.

```csharp
public string Prerelease { get; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### Revision <a href="#ks_reactor_client_ksversion_revision" id="ks_reactor_client_ksversion_revision"></a>

Revision number

```csharp
public uint Revision { get; }
```

#### Property Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

## Methods

### Compare(ksVersion, Precision) <a href="#ks_reactor_client_ksversion_compare_ks_reactor_client_ksversion_ks_reactor_client_ksversion_precisio" id="ks_reactor_client_ksversion_compare_ks_reactor_client_ksversion_ks_reactor_client_ksversion_precisio"></a>

Compares the version with another version up to the specified precision level.

```csharp
public int Compare(ksVersion other, ksVersion.Precision precision = Precision.BUILD)
```

#### Parameters

`other` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

Other version to compare with.

`precision` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md).[Precision](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion/ks.reactor.client.ksversion.precision.md)

Which version numbers to compare.

#### Returns

[int](https://learn.microsoft.com/dotnet/api/system.int32)

Negative value if this version is lower than the other version, positive value if is higher, and zero if they are the same up to the specified precision level.

### Equals(object) <a href="#ks_reactor_client_ksversion_equals_system_object" id="ks_reactor_client_ksversion_equals_system_object"></a>

Checks if this version is equal to an object.

```csharp
public override bool Equals(object obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)

obj to compare with.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if this version is equal to the object.

### Equals(ksVersion) <a href="#ks_reactor_client_ksversion_equals_ks_reactor_client_ksversion" id="ks_reactor_client_ksversion_equals_ks_reactor_client_ksversion"></a>

Checks if the version is the same as another.

```csharp
public bool Equals(ksVersion other)
```

#### Parameters

`other` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

other to compare with.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if the versions are the same.

### Equals(ksVersion, Precision) <a href="#ks_reactor_client_ksversion_equals_ks_reactor_client_ksversion_ks_reactor_client_ksversion_precision" id="ks_reactor_client_ksversion_equals_ks_reactor_client_ksversion_ks_reactor_client_ksversion_precision"></a>

Checks if the version is the same as another up to the specified precision level.

```csharp
public bool Equals(ksVersion other, ksVersion.Precision precision)
```

#### Parameters

`other` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

Other version to compare with.

`precision` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md).[Precision](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion/ks.reactor.client.ksversion.precision.md)

Which version numbers to compare.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the versions are the same up the to specified precision level.

### FromString(string) <a href="#ks_reactor_client_ksversion_fromstring_system_string" id="ks_reactor_client_ksversion_fromstring_system_string"></a>

Constructs a [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md) from a version string. Throws an exception if the string cannot be parsed to a version.

```csharp
public static ksVersion FromString(string versionString)
```

#### Parameters

`versionString` [string](https://learn.microsoft.com/dotnet/api/system.string)

Version string of the format major#.minor#.revision#-prereleaseString+build#. The minor, revision, prerelease string, and build number are optional. The prerelease string, if present, must be prefixed with '-', and the build number, if present, must be prefixed with '+'.

#### Returns

[ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

### GetHashCode() <a href="#ks_reactor_client_ksversion_gethashcode" id="ks_reactor_client_ksversion_gethashcode"></a>

Gets the hash code.

```csharp
public override int GetHashCode()
```

#### Returns

[int](https://learn.microsoft.com/dotnet/api/system.int32)

hash code

### ToString() <a href="#ks_reactor_client_ksversion_tostring" id="ks_reactor_client_ksversion_tostring"></a>

Gets the version string, including prerelease and build number.

```csharp
public override string ToString()
```

#### Returns

[string](https://learn.microsoft.com/dotnet/api/system.string)

version string

### ToString(bool, bool) <a href="#ks_reactor_client_ksversion_tostring_system_boolean_system_boolean" id="ks_reactor_client_ksversion_tostring_system_boolean_system_boolean"></a>

Gets the version string.

```csharp
public string ToString(bool includePrerelease, bool includeBuild)
```

#### Parameters

`includePrerelease` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

False to exclude prerelease from the version string.

`includeBuild` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

False to exclude build number from the version string.

#### Returns

[string](https://learn.microsoft.com/dotnet/api/system.string)

Versions string

## Operators

### operator ==(ksVersion, ksVersion) <a href="#ks_reactor_client_ksversion_op_equality_ks_reactor_client_ksversion_ks_reactor_client_ksversion" id="ks_reactor_client_ksversion_op_equality_ks_reactor_client_ksversion_ks_reactor_client_ksversion"></a>

Checks if two versions are the same.

```csharp
public static bool operator ==(ksVersion lhs, ksVersion rhs)
```

#### Parameters

`lhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

`rhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if the versions are the same.

### operator >(ksVersion, ksVersion) <a href="#ks_reactor_client_ksversion_op_greaterthan_ks_reactor_client_ksversion_ks_reactor_client_ksversion" id="ks_reactor_client_ksversion_op_greaterthan_ks_reactor_client_ksversion_ks_reactor_client_ksversion"></a>

Checks if a version is newer than another.

```csharp
public static bool operator >(ksVersion lhs, ksVersion rhs)
```

#### Parameters

`lhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

`rhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if `lhs` is newer than `rhs`.

### operator >=(ksVersion, ksVersion) <a href="#ks_reactor_client_ksversion_op_greaterthanorequal_ks_reactor_client_ksversion_ks_reactor_client_ksve" id="ks_reactor_client_ksversion_op_greaterthanorequal_ks_reactor_client_ksversion_ks_reactor_client_ksve"></a>

Checks if a version is newer or equal to another.

```csharp
public static bool operator >=(ksVersion lhs, ksVersion rhs)
```

#### Parameters

`lhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

`rhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if `lhs` is newer or equal to `rhs`.

### operator !=(ksVersion, ksVersion) <a href="#ks_reactor_client_ksversion_op_inequality_ks_reactor_client_ksversion_ks_reactor_client_ksversion" id="ks_reactor_client_ksversion_op_inequality_ks_reactor_client_ksversion_ks_reactor_client_ksversion"></a>

Checks if two versions are different.

```csharp
public static bool operator !=(ksVersion lhs, ksVersion rhs)
```

#### Parameters

`lhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

`rhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if the versions are different.

### operator <(ksVersion, ksVersion) <a href="#ks_reactor_client_ksversion_op_lessthan_ks_reactor_client_ksversion_ks_reactor_client_ksversion" id="ks_reactor_client_ksversion_op_lessthan_ks_reactor_client_ksversion_ks_reactor_client_ksversion"></a>

Checks if a version is older than another.

```csharp
public static bool operator <(ksVersion lhs, ksVersion rhs)
```

#### Parameters

`lhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

`rhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if `lhs` is older than `rhs`.

### operator <=(ksVersion, ksVersion) <a href="#ks_reactor_client_ksversion_op_lessthanorequal_ks_reactor_client_ksversion_ks_reactor_client_ksversi" id="ks_reactor_client_ksversion_op_lessthanorequal_ks_reactor_client_ksversion_ks_reactor_client_ksversi"></a>

Checks if a version is older or equal to another.

```csharp
public static bool operator <=(ksVersion lhs, ksVersion rhs)
```

#### Parameters

`lhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

`rhs` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if `lhs` is older or equal to `rhs`.
