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