‪TechbloxModdingAPI  ‪v2.2.0
‪The unofficial Techblox modding API
TechbloxModdingAPI.Utility.OptionalRef< T > Struct Template Reference

Public Member Functions

 OptionalRef (EcsObjectBase obj, bool unmanaged)
 ‪Wraps the initializer data, if present. More...
 
 OptionalRef (MB< T > array, uint index)
 
 OptionalRef (NB< T > array, uint index)
 
ref T Get ()
 ‪Returns the value or a default value if empty. Supports objects that are being initialized. More...
 
T? Nullable ()
 

Public Attributes

bool Exists => state != State.Empty
 

Properties

Value [get, set]
 ‪A non-by-ref view that allows getting and setting the value. More...
 

Constructor & Destructor Documentation

◆ OptionalRef() [1/3]

TechbloxModdingAPI.Utility.OptionalRef< T >.OptionalRef ( NB< T >  array,
uint  index 
)
inline

◆ OptionalRef() [2/3]

TechbloxModdingAPI.Utility.OptionalRef< T >.OptionalRef ( MB< T >  array,
uint  index 
)
inline

◆ OptionalRef() [3/3]

TechbloxModdingAPI.Utility.OptionalRef< T >.OptionalRef ( EcsObjectBase  obj,
bool  unmanaged 
)
inline

‪Wraps the initializer data, if present.

Parameters
obj‪The object with the initializer
unmanaged‪Whether the struct is unmanaged

Member Function Documentation

◆ Get()

ref T TechbloxModdingAPI.Utility.OptionalRef< T >.Get ( )
inline

‪Returns the value or a default value if empty. Supports objects that are being initialized.

Returns
‪The value or the default value

◆ Nullable()

T? TechbloxModdingAPI.Utility.OptionalRef< T >.Nullable ( )
inline

Member Data Documentation

◆ Exists

bool TechbloxModdingAPI.Utility.OptionalRef< T >.Exists => state != State.Empty

Property Documentation

◆ Value

‪A non-by-ref view that allows getting and setting the value.


The documentation for this struct was generated from the following file: