Class UInts
Various utility classes relating to floats.
Inheritance
Inherited Members
Namespace: GameKit.Dependencies.Utilities
Assembly: GameKit.Dependencies.dll
Syntax
public static class UInts
Methods
Clamp(UInt32, UInt32, UInt32)
Returns a clamped int within a specified range.
Declaration
public static uint Clamp(uint value, uint minimum, uint maximum)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | value | Value to clamp. |
| System.UInt32 | minimum | Minimum value. |
| System.UInt32 | maximum | Maximum value. |
Returns
| Type | Description |
|---|---|
| System.UInt32 |
Min(UInt32, UInt32)
Returns whichever value is lower.
Declaration
public static uint Min(uint a, uint b)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | a | |
| System.UInt32 | b |
Returns
| Type | Description |
|---|---|
| System.UInt32 |
Pad(UInt32, Int32)
Pads an index a specified value. Preferred over typical padding so that pad values used with skins can be easily found in the code.
Declaration
public static string Pad(this uint value, int padding)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | value | |
| System.Int32 | padding |
Returns
| Type | Description |
|---|---|
| System.String |
RandomExclusiveRange(UInt32, UInt32)
Provides a random exclusive int within a given range. Preferred over Unity's Random to eliminate confusion as Unity uses inclusive for floats max, and exclusive for int max.
Declaration
public static uint RandomExclusiveRange(uint minimum, uint maximum)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | minimum | Inclusive minimum value. |
| System.UInt32 | maximum | Exclusive maximum value. |
Returns
| Type | Description |
|---|---|
| System.UInt32 |
RandomInclusiveRange(UInt32, UInt32)
Provides a random inclusive int within a given range. Preferred over Unity's Random to eliminate confusion as Unity uses inclusive for floats max, and exclusive for int max.
Declaration
public static uint RandomInclusiveRange(uint minimum, uint maximum)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | minimum | Inclusive minimum value. |
| System.UInt32 | maximum | Inclusive maximum value. |
Returns
| Type | Description |
|---|---|
| System.UInt32 |
ValuesMatch(UInt32[])
Determins if all values passed in are the same.
Declaration
public static bool ValuesMatch(params uint[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32[] | values | Values to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if all values are the same. |