Class Enums
Inheritance
System.Object
Enums
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GameKit.Dependencies.Utilities
Assembly: GameKit.Dependencies.dll
Syntax
public static class Enums
Methods
ContainsAllocated(Enum, Enum)
Returns if whole(extended enum) has any of the part values.
Declaration
public static bool ContainsAllocated(this Enum whole, Enum part)
Parameters
Type | Name | Description |
---|---|---|
System.Enum | whole | |
System.Enum | part | Values to check for within whole. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true part is within whole. |
Equals(Enum, Enum)
Returns if an enum equals a specified value.
Declaration
public static bool Equals(this Enum value, Enum target)
Parameters
Type | Name | Description |
---|---|---|
System.Enum | value | |
System.Enum | target |
Returns
Type | Description |
---|---|
System.Boolean |
FromString<T>(String, T)
Determine an enum value from a given string. This can be an expensive function.
Declaration
public static T FromString<T>(string text, T defaultValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text of string. |
T | defaultValue | Default value if enum couldn't be found. |
Returns
Type | Description |
---|---|
T | Enum found or default value if no enum is found. |
Type Parameters
Name | Description |
---|---|
T |
GetHighestValue<T>()
Returns the highest numeric value for T.
Declaration
public static int GetHighestValue<T>()
Returns
Type | Description |
---|---|
System.Int32 |
Type Parameters
Name | Description |
---|---|
T |
ReverseContains(Enum, Enum)
Returns if part values contains any of whole(extended enum).
Declaration
public static bool ReverseContains(this Enum whole, Enum part)
Parameters
Type | Name | Description |
---|---|---|
System.Enum | whole | |
System.Enum | part |
Returns
Type | Description |
---|---|
System.Boolean | Returns true whole is within part. |
SameType(Enum, Enum)
Returns if a is the same Enum as b.
Declaration
public static bool SameType(Enum a, Enum b)
Parameters
Type | Name | Description |
---|---|---|
System.Enum | a | |
System.Enum | b |
Returns
Type | Description |
---|---|
System.Boolean |