Class Variable
Stores a single value of any type.
Inheritance
System.Object
Variable
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: BulletStorm.Util
Assembly: BulletStorm.dll
Syntax
[Serializable]
public class Variable
Properties
| Improve this Doc View SourceIsEmpty
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Type
Type of the stored value.
Declaration
public Type Type { get; }
Property Value
Type | Description |
---|---|
System.Type |
Methods
| Improve this Doc View SourceGetValue<T>()
Get stored value. Log error if value conflicts with given type.
Declaration
public T GetValue<T>()
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | Value type. |
HasValue<T>()
Declaration
public bool HasValue<T>()
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
T |
Reset()
Reset the variable to empty.
Declaration
public void Reset()
SetValue<T>(T)
Set value of the variable. Log error if stored value conflicts with new value.
Declaration
public void SetValue<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Any value. |
Type Parameters
Name | Description |
---|---|
T | Value type. |
TryGetValue<T>(out T)
Try to get stored value.
Declaration
public bool TryGetValue<T>(out T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Stored value. |
Returns
Type | Description |
---|---|
System.Boolean | True if success. |
Type Parameters
Name | Description |
---|---|
T | Value type. |