Show / Hide Table of Contents

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 Source

IsEmpty

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Type

Type of the stored value.

Declaration
public Type Type { get; }
Property Value
Type Description
System.Type

Methods

| Improve this Doc View Source

GetValue<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.

| Improve this Doc View Source

HasValue<T>()

Declaration
public bool HasValue<T>()
Returns
Type Description
System.Boolean
Type Parameters
Name Description
T
| Improve this Doc View Source

Reset()

Reset the variable to empty.

Declaration
public void Reset()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX