Quantum 3 3.0.5

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

Represents a generalized reference to an entity prototype - either EntityPrototype asset or an entity from Map. More...

Inherits IEquatable< EntityPrototypeRef >.

Public Member Functions

readonly bool Equals (EntityPrototypeRef other)
 
readonly override bool Equals (object obj)
 
readonly override int GetHashCode ()
 
readonly override string ToString ()
 Returns a string that represents the current EntityPrototypeRef in the format of: More...
 

Static Public Member Functions

static EntityPrototypeRef FromMasterAsset (AssetRef< Map > asset, int internalAssetId)
 Creates a new entity prototype reference from an entity in a map asset. More...
 
static EntityPrototypeRef FromMasterAsset (Map asset, int internalAssetId)
 Creates a new entity prototype reference from an entity in a map asset. More...
 
static EntityPrototypeRef FromPrototypeAsset (AssetRef< EntityPrototype > prototype)
 
static EntityPrototypeRef FromPrototypeAsset (EntityPrototype prototype)
 Creates a new entity prototype reference from an entity prototype asset. More...
 
static bool operator!= (EntityPrototypeRef a, EntityPrototypeRef b)
 
static bool operator== (EntityPrototypeRef a, EntityPrototypeRef b)
 
static void Serialize (void *ptr, FrameSerializer stream)
 

Public Attributes

AssetRef Asset
 The asset reference of EntityPrototype or Map. More...
 
int InnerAssetId
 If the entity prototype reference comes from a map asset, this is the index of the entity in the map. More...
 
readonly bool IsValid => Asset.Id.IsValid
 Returns true if the entity prototype reference is valid. More...
 

Static Public Attributes

static EntityPrototypeRef Invalid => new EntityPrototypeRef()
 Invalid entity prototype reference. More...
 
const int SIZE = 16
 

Detailed Description

Represents a generalized reference to an entity prototype - either EntityPrototype asset or an entity from Map.

Member Function Documentation

◆ ToString()

readonly override string Quantum.EntityPrototypeRef.ToString ( )
inline

Returns a string that represents the current EntityPrototypeRef in the format of:

[EntityPrototypeRef Asset: {Asset}, InnerAssetId: {InnerAssetId}]

◆ FromPrototypeAsset()

static EntityPrototypeRef Quantum.EntityPrototypeRef.FromPrototypeAsset ( EntityPrototype  prototype)
inlinestatic

Creates a new entity prototype reference from an entity prototype asset.

Parameters
prototype
Returns

◆ FromMasterAsset() [1/2]

static EntityPrototypeRef Quantum.EntityPrototypeRef.FromMasterAsset ( Map  asset,
int  internalAssetId 
)
inlinestatic

Creates a new entity prototype reference from an entity in a map asset.

Parameters
assetMap asset
internalAssetIdIndex of the entity prototype
Returns

◆ FromMasterAsset() [2/2]

static EntityPrototypeRef Quantum.EntityPrototypeRef.FromMasterAsset ( AssetRef< Map asset,
int  internalAssetId 
)
inlinestatic

Creates a new entity prototype reference from an entity in a map asset.

Parameters
assetMap asset
internalAssetIdIndex of the entity prototype
Returns

Member Data Documentation

◆ Asset

AssetRef Quantum.EntityPrototypeRef.Asset

The asset reference of EntityPrototype or Map.

◆ InnerAssetId

int Quantum.EntityPrototypeRef.InnerAssetId

If the entity prototype reference comes from a map asset, this is the index of the entity in the map.

◆ Invalid

EntityPrototypeRef Quantum.EntityPrototypeRef.Invalid => new EntityPrototypeRef()
static

Invalid entity prototype reference.

◆ IsValid

readonly bool Quantum.EntityPrototypeRef.IsValid => Asset.Id.IsValid

Returns true if the entity prototype reference is valid.