G1R AngelScript
Scripting reference for the Gothic 1 Remake
Loading...
Searching...
No Matches
TOptional Class Reference

Public Member Functions

Functions
void Set (const T &in Value) const
TOptional< T > & opAssign (const T &in Value)
bool opEquals (TOptional< T > Other) const
bool IsSet () const
 Returns if the optional has a valid value. This must be true in order for Get() or GetValue() to be called.
TOptional< T > & opAssign (TOptional< T > Other)
const T & GetValue () const
 Gets a const reference to the optional's set value. IsSet() must return true for this function to be called.
T & GetValue ()
 Gets a non-const reference to the optional's set value. IsSet() must return true for this function to be called.
const T & Get (const T &in DefaultValue) const
 If set returns the optional's set value, otherwise returns DefaultValue.
void Reset ()
 Destruct the value inside the optional and unset it.

Public Attributes

Variables
const T & Value

Member Function Documentation

◆ Get()

const T & Get ( const T &in DefaultValue) const

If set returns the optional's set value, otherwise returns DefaultValue.

◆ GetValue() [1/2]

T & GetValue ( )

Gets a non-const reference to the optional's set value. IsSet() must return true for this function to be called.

◆ GetValue() [2/2]

const T & GetValue ( ) const

Gets a const reference to the optional's set value. IsSet() must return true for this function to be called.

◆ IsSet()

bool IsSet ( ) const

Returns if the optional has a valid value. This must be true in order for Get() or GetValue() to be called.

◆ opAssign() [1/2]

TOptional< T > & opAssign ( const T &in Value)

◆ opAssign() [2/2]

TOptional< T > & opAssign ( TOptional< T > Other)

◆ opEquals()

bool opEquals ( TOptional< T > Other) const

◆ Reset()

void Reset ( )

Destruct the value inside the optional and unset it.

◆ Set()

void Set ( const T &in Value) const

Member Data Documentation

◆ Value

const T& Value