Represents a generalized reference to a component prototype. The prototype can either come from an entity prototype asset or from a map asset. Type is stored as a ComponentTypeRef. More...
Inherits IEquatable< ComponentPrototypeRef >.
Public Member Functions | |
readonly bool | Equals (ComponentPrototypeRef other) |
readonly override bool | Equals (object obj) |
readonly override int | GetHashCode () |
readonly override string | ToString () |
Returns a string that represents the current ComponentPrototypeRef in the format of: More... | |
Static Public Member Functions | |
static ComponentPrototypeRef | FromEntityPrototypeRefAndType (EntityPrototypeRef prototypeRef, ComponentTypeRef type) |
Creates a new ComponentPrototypeRef from the specified EntityPrototypeRef and component type. More... | |
static ComponentPrototypeRef | FromEntityPrototypeRefAndType (EntityPrototypeRef prototypeRef, Type type) |
Creates a new ComponentPrototypeRef from the specified EntityPrototypeRef and component type. More... | |
static ComponentPrototypeRef | FromEntityPrototypeRefAndTypeIndex (EntityPrototypeRef prototypeRef, int typeIndex) |
Creates a new ComponentPrototypeRef from the specified EntityPrototypeRef and component type index. More... | |
static bool | operator!= (ComponentPrototypeRef a, ComponentPrototypeRef b) |
static bool | operator== (ComponentPrototypeRef a, ComponentPrototypeRef b) |
static void | Serialize (void *ptr, FrameSerializer stream) |
Serializes the ComponentPrototypeRef to the specified FrameSerializer stream. More... | |
Public Attributes | |
AssetRef | Asset |
The asset reference of the entity prototype asset or the map asset. More... | |
ComponentTypeRef | ComponentType |
Type of the component. More... | |
readonly EntityPrototypeRef | EntityPrototypeRef => new EntityPrototypeRef() { Asset = Asset, InnerAssetId = InnerAssetId } |
Returns a reference to the entity prototype hosting the component prototype. More... | |
int | InnerAssetId |
Index of the host entity prototype, if the component prototype comes from a map asset. More... | |
readonly bool | IsValid => Asset.Id.IsValid && ComponentType.IsValid |
Returns true if the component prototype reference is valid. More... | |
Static Public Attributes | |
const int | SIZE = AssetRef.SIZE + sizeof(int) + ComponentTypeRef.SIZE |
Properties | |
readonly int | ComponentTypeIndex [get] |
Returns the index of the component type. More... | |
Represents a generalized reference to a component prototype. The prototype can either come from an entity prototype asset or from a map asset. Type is stored as a ComponentTypeRef.
|
inlinestatic |
Serializes the ComponentPrototypeRef to the specified FrameSerializer stream.
ptr | A pointer to the ComponentPrototypeRef to be serialized. |
stream | The FrameSerializer stream to serialize to. |
|
inline |
Returns a string that represents the current ComponentPrototypeRef in the format of:
[ComponentPrototypeRef Asset: {Asset}, InnerAssetId: {InnerAssetId}, ComponentType: {ComponentType}]
|
inlinestatic |
Creates a new ComponentPrototypeRef from the specified EntityPrototypeRef and component type index.
prototypeRef | The EntityPrototypeRef to create the ComponentPrototypeRef from. |
typeIndex | The index of the component type. |
|
inlinestatic |
Creates a new ComponentPrototypeRef from the specified EntityPrototypeRef and component type.
prototypeRef | The EntityPrototypeRef to create the ComponentPrototypeRef from. |
type | The ComponentTypeRef of the component. |
|
inlinestatic |
Creates a new ComponentPrototypeRef from the specified EntityPrototypeRef and component type.
prototypeRef | The EntityPrototypeRef to create the ComponentPrototypeRef from. |
type | The Type of the component. |
AssetRef Quantum.ComponentPrototypeRef.Asset |
The asset reference of the entity prototype asset or the map asset.
int Quantum.ComponentPrototypeRef.InnerAssetId |
Index of the host entity prototype, if the component prototype comes from a map asset.
ComponentTypeRef Quantum.ComponentPrototypeRef.ComponentType |
Type of the component.
readonly bool Quantum.ComponentPrototypeRef.IsValid => Asset.Id.IsValid && ComponentType.IsValid |
Returns true if the component prototype reference is valid.
readonly EntityPrototypeRef Quantum.ComponentPrototypeRef.EntityPrototypeRef => new EntityPrototypeRef() { Asset = Asset, InnerAssetId = InnerAssetId } |
Returns a reference to the entity prototype hosting the component prototype.
|
get |
Returns the index of the component type.