Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Quantum.AssetGuid Struct Reference

Represents a unique identifier for an asset. More...

Inherits IEquatable< AssetGuid >, and IComparable< AssetGuid >.

Public Member Functions

 AssetGuid (Int64 value)
 Initializes a new instance of the AssetGuid struct. More...
 
int CompareTo (AssetGuid other)
 Compares the current AssetGuid with another AssetGuid and returns an integer that indicates whether the current AssetGuid is less than, equal to, or greater than the other AssetGuid. More...
 
bool Equals (AssetGuid other)
 Determines whether the specified AssetGuid is equal to the current AssetGuid. More...
 
override Boolean Equals (Object obj)
 Determines whether the specified object is equal to the current AssetGuid. More...
 
override Int32 GetHashCode ()
 Returns the hash code for this AssetGuid. More...
 
override string ToString ()
 Returns a string representation of the AssetGuid. More...
 
string ToString (bool includeBrackets)
 Returns a string representation of the AssetGuid. More...
 

Static Public Member Functions

static AssetGuid NewGuid ()
 Generates a new random AssetGuid. More...
 
static implicit operator AssetGuid (Int64 value)
 Implicitly converts a long value to an AssetGuid. More...
 
static Boolean operator!= (AssetGuid a, AssetGuid b)
 Determines whether two AssetGuids are not equal. More...
 
static Boolean operator== (AssetGuid a, AssetGuid b)
 Determines whether two AssetGuids are equal. More...
 
static void Print (void *ptr, FramePrinter printer)
 Prints the AssetGuid. More...
 
static void Serialize (void *ptr, IDeterministicFrameSerializer serializer)
 Serializes the AssetGuid. More...
 
static bool TryParse (string str, out AssetGuid result, bool includeBrackets)
 Tries to parse a string representation of an AssetGuid. More...
 

Public Attributes

bool IsDynamic => (Value & AssetGuid.DynamicBit) == AssetGuid.DynamicBit
 Returns true if the AssetGuid is valid and dynamic (reserved for DynamicAssetDB assets). More...
 
bool IsValid => Value != Invalid
 Returns true if the AssetGuid is valid (non-zero). More...
 
Int64 Value
 Raw value of the AssetGuid. More...
 

Static Public Attributes

const Int64 DynamicBit = 1L << 63
 The bit that indicates that the AssetGuid is dynamic (reserved for DynamicAssetDB assets). More...
 
const Int64 Invalid = 0L
 Invalid value of the AssetGuid. More...
 
const Int64 None = Invalid
 None value of the AssetGuid. More...
 
const Int64 ReservedBits = DynamicBit | (1L << 62)
 The reserved bits of the AssetGuid. More...
 
const int SIZE = sizeof(ulong)
 The size of the AssetGuid in bytes. More...
 

Detailed Description

Represents a unique identifier for an asset.

Constructor & Destructor Documentation

◆ AssetGuid()

Quantum.AssetGuid.AssetGuid ( Int64  value)
inline

Initializes a new instance of the AssetGuid struct.

Parameters
valueThe value of the AssetGuid.

Member Function Documentation

◆ NewGuid()

static AssetGuid Quantum.AssetGuid.NewGuid ( )
inlinestatic

Generates a new random AssetGuid.

Returns
A new random AssetGuid.

◆ Serialize()

static void Quantum.AssetGuid.Serialize ( void *  ptr,
IDeterministicFrameSerializer  serializer 
)
inlinestatic

Serializes the AssetGuid.

Parameters
ptrA pointer to the AssetGuid.
serializerThe serializer to use.

◆ Print()

static void Quantum.AssetGuid.Print ( void *  ptr,
FramePrinter  printer 
)
inlinestatic

Prints the AssetGuid.

Parameters
ptrA pointer to the AssetGuid.
printerThe printer to use.

◆ Equals() [1/2]

bool Quantum.AssetGuid.Equals ( AssetGuid  other)
inline

Determines whether the specified AssetGuid is equal to the current AssetGuid.

Parameters
otherThe AssetGuid to compare with the current AssetGuid.
Returns
true if the specified AssetGuid is equal to the current AssetGuid; otherwise, false.

◆ CompareTo()

int Quantum.AssetGuid.CompareTo ( AssetGuid  other)
inline

Compares the current AssetGuid with another AssetGuid and returns an integer that indicates whether the current AssetGuid is less than, equal to, or greater than the other AssetGuid.

Parameters
otherThe AssetGuid to compare with the current AssetGuid.
Returns
A value that indicates the relative order of the AssetGuids being compared.

◆ Equals() [2/2]

override Boolean Quantum.AssetGuid.Equals ( Object  obj)
inline

Determines whether the specified object is equal to the current AssetGuid.

Parameters
objThe object to compare with the current AssetGuid.
Returns
true if the specified object is equal to the current AssetGuid; otherwise, false.

◆ GetHashCode()

override Int32 Quantum.AssetGuid.GetHashCode ( )
inline

Returns the hash code for this AssetGuid.

Returns
A 32-bit signed integer hash code.

◆ operator==()

static Boolean Quantum.AssetGuid.operator== ( AssetGuid  a,
AssetGuid  b 
)
inlinestatic

Determines whether two AssetGuids are equal.

Parameters
aThe first AssetGuid to compare.
bThe second AssetGuid to compare.
Returns
true if the AssetGuids are equal; otherwise, false.

◆ operator!=()

static Boolean Quantum.AssetGuid.operator!= ( AssetGuid  a,
AssetGuid  b 
)
inlinestatic

Determines whether two AssetGuids are not equal.

Parameters
aThe first AssetGuid to compare.
bThe second AssetGuid to compare.
Returns
true if the AssetGuids are not equal; otherwise, false.

◆ operator AssetGuid()

static implicit Quantum.AssetGuid.operator AssetGuid ( Int64  value)
inlinestatic

Implicitly converts a long value to an AssetGuid.

Parameters
valueThe long value to convert.
Returns
An AssetGuid with the specified value.

◆ ToString() [1/2]

override string Quantum.AssetGuid.ToString ( )
inline

Returns a string representation of the AssetGuid.

Returns
A string representation of the AssetGuid.

◆ ToString() [2/2]

string Quantum.AssetGuid.ToString ( bool  includeBrackets)
inline

Returns a string representation of the AssetGuid.

Parameters
includeBracketsIndicates whether to include brackets in the string representation.
Returns
A string representation of the AssetGuid.

◆ TryParse()

static bool Quantum.AssetGuid.TryParse ( string  str,
out AssetGuid  result,
bool  includeBrackets 
)
inlinestatic

Tries to parse a string representation of an AssetGuid.

Parameters
strThe string representation of the AssetGuid.
resultWhen this method returns, contains the parsed AssetGuid if the parsing succeeded, or default if the parsing failed.
includeBracketsIndicates whether the string representation includes brackets.
Returns
true if the parsing succeeded; otherwise, false.

Member Data Documentation

◆ SIZE

const int Quantum.AssetGuid.SIZE = sizeof(ulong)
static

The size of the AssetGuid in bytes.

◆ DynamicBit

const Int64 Quantum.AssetGuid.DynamicBit = 1L << 63
static

The bit that indicates that the AssetGuid is dynamic (reserved for DynamicAssetDB assets).

◆ ReservedBits

const Int64 Quantum.AssetGuid.ReservedBits = DynamicBit | (1L << 62)
static

The reserved bits of the AssetGuid.

◆ Invalid

const Int64 Quantum.AssetGuid.Invalid = 0L
static

Invalid value of the AssetGuid.

◆ None

const Int64 Quantum.AssetGuid.None = Invalid
static

None value of the AssetGuid.

◆ Value

Int64 Quantum.AssetGuid.Value

Raw value of the AssetGuid.

◆ IsValid

bool Quantum.AssetGuid.IsValid => Value != Invalid

Returns true if the AssetGuid is valid (non-zero).

◆ IsDynamic

bool Quantum.AssetGuid.IsDynamic => (Value & AssetGuid.DynamicBit) == AssetGuid.DynamicBit

Returns true if the AssetGuid is valid and dynamic (reserved for DynamicAssetDB assets).