Barotrauma Client Doc
Barotrauma.Option< T > Class Template Reference

Classes

struct  UnspecifiedNone
 

Public Member Functions

bool IsSome ()
 
bool IsNone ()
 
bool TryUnwrap< T1 > ([NotNullWhen(returnValue:true)] out T1? outValue)
 
bool TryUnwrap ([NotNullWhen(returnValue:true)] out T? outValue)
 
Option< TType > Select< TType > (Func< T, TType > selector)
 
Option< TType > Bind< TType > (Func< T, Option< TType >> binder)
 
Match (Func< T, T > some, Func< T > none)
 
void Match (Action< T > some, Action none)
 
Fallback (T fallback)
 
Option< T > Fallback (Option< T > fallback)
 
override bool Equals (object? obj)
 
bool ValueEquals (T otherValue)
 
override int GetHashCode ()
 
override string ToString ()
 

Static Public Member Functions

static Option< T > Some (T value)
 
static bool operator== (Option< T > a, Option< T > b)
 
static bool operator!= (Option< T > a, Option< T > b)
 
static Option< T > None ()
 
static implicit operator Option< T > (in Option.UnspecifiedNone _)
 
static Option< T > Some< T > (T value)
 

Properties

static UnspecifiedNone None [get]
 

Detailed Description

Type Constraints
T :notnull 

Definition at line 7 of file Option.cs.

Member Function Documentation

◆ Bind< TType >()

Option<TType> Barotrauma.Option< T >.Bind< TType > ( Func< T, Option< TType >>  binder)
Type Constraints
TType :notnull 
TType :TryUnwrap 
TType :out 
TType :T 
TType :selfValue 
TType :binder 
TType :selfValue 
TType :Option.None 

◆ Equals()

override bool Barotrauma.Option< T >.Equals ( object?  obj)

◆ Fallback() [1/2]

Option<T> Barotrauma.Option< T >.Fallback ( Option< T >  fallback)

◆ Fallback() [2/2]

T Barotrauma.Option< T >.Fallback ( fallback)

◆ GetHashCode()

override int Barotrauma.Option< T >.GetHashCode ( )

◆ IsNone()

bool Barotrauma.Option< T >.IsNone ( )

◆ IsSome()

bool Barotrauma.Option< T >.IsSome ( )

◆ Match() [1/2]

void Barotrauma.Option< T >.Match ( Action< T >  some,
Action  none 
)

Definition at line 47 of file Option.cs.

◆ Match() [2/2]

T Barotrauma.Option< T >.Match ( Func< T, T >  some,
Func< T >  none 
)

◆ None()

static Option<T> Barotrauma.Option< T >.None ( )
static

◆ operator Option< T >()

static implicit Barotrauma.Option< T >.operator Option< T > ( in Option< T >.UnspecifiedNone  _)
static

◆ operator!=()

static bool Barotrauma.Option< T >.operator!= ( Option< T >  a,
Option< T >  b 
)
static

◆ operator==()

static bool Barotrauma.Option< T >.operator== ( Option< T >  a,
Option< T >  b 
)
static

◆ Select< TType >()

Option<TType> Barotrauma.Option< T >.Select< TType > ( Func< T, TType >  selector)
Type Constraints
TType :notnull 
TType :TryUnwrap 
TType :out 
TType :T 
TType :selfValue 
TType :Option.Some 
TType :selector 
TType :selfValue 
TType :Option.None 

◆ Some()

static Option<T> Barotrauma.Option< T >.Some ( value)
static

◆ Some< T >()

static Option<T> Barotrauma.Option< T >.Some< T > ( value)
static
Type Constraints
T :notnull 
T :Option<T> 
T :Some 
T :value 

◆ ToString()

override string Barotrauma.Option< T >.ToString ( )

◆ TryUnwrap()

bool Barotrauma.Option< T >.TryUnwrap ( [NotNullWhen(returnValue:true)] out T?  outValue)

◆ TryUnwrap< T1 >()

bool Barotrauma.Option< T >.TryUnwrap< T1 > ( [NotNullWhen(returnValue: true)] out T1?  outValue)
Type Constraints
T1 :T 

Definition at line 21 of file Option.cs.

◆ ValueEquals()

bool Barotrauma.Option< T >.ValueEquals ( otherValue)

Property Documentation

◆ None

UnspecifiedNone Barotrauma.Option< T >.None
staticget

Definition at line 118 of file Option.cs.