Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Photon.Deterministic.NullableFP Struct Reference

A serializable equivalent of Nullable<FP>. More...

Public Member Functions

override int GetHashCode ()
 Computes the hash code for the current instance of the NullableFP struct. More...
 
FP ValueOrDefault (FP v)
 If HasValue is true, returns Value. Otherwise returns v . More...
 

Static Public Member Functions

static implicit operator NullableFP (FP v)
 Converts v to NullableFP. More...
 
static void Serialize (NullableFP *ptr, IDeterministicFrameSerializer serializer)
 Serializes a NullableFP object using the given serializer. More...
 

Public Attributes

long _hasValue
 If 1, then _value is valid. More...
 
FP _value
 The value. More...
 

Static Public Attributes

const int SIZE = sizeof(long) + FP.SIZE
 Size of the struct in bytes. More...
 

Properties

Boolean HasValue [get]
 Returns true if this nullable has a value. More...
 
FP Value [get]
 Returns current value. More...
 

Detailed Description

A serializable equivalent of Nullable<FP>.

Member Function Documentation

◆ ValueOrDefault()

FP Photon.Deterministic.NullableFP.ValueOrDefault ( FP  v)
inline

If HasValue is true, returns Value. Otherwise returns v .

Parameters
v
Returns

◆ operator NullableFP()

static implicit Photon.Deterministic.NullableFP.operator NullableFP ( FP  v)
inlinestatic

Converts v to NullableFP.

Parameters
v
Returns

◆ Serialize()

static void Photon.Deterministic.NullableFP.Serialize ( NullableFP ptr,
IDeterministicFrameSerializer  serializer 
)
inlinestatic

Serializes a NullableFP object using the given serializer.

Parameters
ptrA pointer to the NullableFP object to be serialized.
serializerThe serializer object used for serialization.

◆ GetHashCode()

override int Photon.Deterministic.NullableFP.GetHashCode ( )
inline

Computes the hash code for the current instance of the NullableFP struct.

Returns
A 32-bit signed integer hash code.

Member Data Documentation

◆ SIZE

const int Photon.Deterministic.NullableFP.SIZE = sizeof(long) + FP.SIZE
static

Size of the struct in bytes.

◆ _hasValue

long Photon.Deterministic.NullableFP._hasValue

If 1, then _value is valid.

◆ _value

FP Photon.Deterministic.NullableFP._value

The value.

Property Documentation

◆ HasValue

Boolean Photon.Deterministic.NullableFP.HasValue
get

Returns true if this nullable has a value.

◆ Value

FP Photon.Deterministic.NullableFP.Value
get

Returns current value.

Exceptions
NullReferenceExceptionIf HasValue is false