Class Ints
Various utility classes relating to floats.
Inheritance
Inherited Members
Namespace: GameKit.Dependencies.Utilities
Assembly: GameKit.Dependencies.dll
Syntax
public static class Ints
Methods
Clamp(Int32, Int32, Int32)
Returns a clamped int within a specified range.
Declaration
public static int Clamp(int value, int minimum, int maximum)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | value | Value to clamp. |
| System.Int32 | minimum | Minimum value. |
| System.Int32 | maximum | Maximum value. |
Returns
| Type | Description |
|---|---|
| System.Int32 |
PadInt(Int32, 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 PadInt(int value, int padding)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | value | |
| System.Int32 | padding |
Returns
| Type | Description |
|---|---|
| System.String |
RandomExclusiveRange(Int32, Int32)
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 int RandomExclusiveRange(int minimum, int maximum)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | minimum | Inclusive minimum value. |
| System.Int32 | maximum | Exclusive maximum value. |
Returns
| Type | Description |
|---|---|
| System.Int32 |
RandomInclusiveRange(Int32, Int32)
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 int RandomInclusiveRange(int minimum, int maximum)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | minimum | Inclusive minimum value. |
| System.Int32 | maximum | Inclusive maximum value. |
Returns
| Type | Description |
|---|---|
| System.Int32 |
ValuesMatch(Int32[])
Determins if all values passed in are the same.
Declaration
public static bool ValuesMatch(params int[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32[] | values | Values to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if all values are the same. |