Quantum 3 3.0.5

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ComponentTypeRef Struct Reference

A persistent and serializable reference to a component type. Is valid as long as the component type is not renamed. More...

Inherits IEquatable< ComponentTypeRef >.

Public Member Functions

readonly bool Equals (ComponentTypeRef other)
 
readonly override bool Equals (object obj)
 
readonly override int GetHashCode ()
 
bool Is (Type type)
 Returns true if this component type reference points to type . More...
 
bool Is< T > ()
 Returns true if this component type reference points to T . More...
 

Static Public Member Functions

static ComponentTypeRef FromRaw (uint rawValue)
 Creates a new component type reference from a raw value. More...
 
static ComponentTypeRef FromType (Type type)
 
static ComponentTypeRef FromType< T > ()
 Creates a new component type reference from a type. More...
 
static ComponentTypeRef FromTypeName (string typeName)
 Creates a new component type reference from a type name. More...
 
static bool operator!= (ComponentTypeRef a, ComponentTypeRef b)
 
static bool operator== (ComponentTypeRef a, ComponentTypeRef b)
 

Public Attributes

readonly bool IsValid => RawValue != 0
 Returns true if this component type reference points to any type. More...
 
uint RawValue
 The hash of the component type name. More...
 

Static Public Attributes

const int SIZE = sizeof(uint)
 

Detailed Description

A persistent and serializable reference to a component type. Is valid as long as the component type is not renamed.

Member Function Documentation

◆ FromRaw()

static ComponentTypeRef ComponentTypeRef.FromRaw ( uint  rawValue)
inlinestatic

Creates a new component type reference from a raw value.

Parameters
rawValue
Returns

◆ FromType< T >()

Creates a new component type reference from a type.

Returns
Type Constraints
T :unmanaged 
T :IComponent 
T :FromTypeName 
T :typeof 
T :T 
T :Name 

◆ FromTypeName()

static ComponentTypeRef ComponentTypeRef.FromTypeName ( string  typeName)
inlinestatic

Creates a new component type reference from a type name.

Parameters
typeName
Returns

◆ Is< T >()

bool ComponentTypeRef.Is< T > ( )
inline

Returns true if this component type reference points to T .

Template Parameters
T
Type Constraints
T :unmanaged 
T :IComponent 

◆ Is()

bool ComponentTypeRef.Is ( Type  type)
inline

Returns true if this component type reference points to type .

Parameters
type

Member Data Documentation

◆ RawValue

uint ComponentTypeRef.RawValue

The hash of the component type name.

◆ IsValid

readonly bool ComponentTypeRef.IsValid => RawValue != 0

Returns true if this component type reference points to any type.