Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::SliceComponent::SliceInstance Class Reference

#include <SliceComponent.h>

Public Member Functions

 AZ_TYPE_INFO (SliceInstance, "{E6F11FB3-E9BF-43BA-BD78-2A19F51D0ED3}")
 
 SliceInstance (const SliceInstanceId &id=SliceInstanceId::CreateRandom())
 
 SliceInstance (SliceInstance &&rhs)
 
 SliceInstance (const SliceInstance &rhs)
 
SliceInstanceoperator= (const SliceInstance &rhs)
 
void ClearInstantiated ()
 Clears the instantiated container. Used when layers are borrowing and returning slice instances.
 
const InstantiatedContainerGetInstantiated () const
 Returns pointer to the instantiated entities. Null if the slice was not instantiated.
 
const DataPatchGetDataPatch () const
 Returns a reference to the data patch, it's always available even when the DataPatch contain no data to apply (no deltas)
 
const DataFlagsPerEntityGetDataFlags () const
 Returns a reference to the data flags per entity.
 
DataFlagsPerEntityGetDataFlags ()
 Returns a reference to the data flags per entity.
 
EntityIdToEntityIdMapGetEntityIdMapForEdit ()
 
const EntityIdToEntityIdMapGetEntityIdMap () const
 
const EntityIdToEntityIdMapGetEntityIdToBaseMap () const
 
bool IsValidEntity (EntityId entityId) const
 Returns whether this entity exists in this instance.
 
const SliceInstanceIdGetId () const
 Returns the instance's unique Id.
 
 operator size_t () const
 
EntityGetMetadataEntity () const
 

Protected Member Functions

void SetId (const SliceInstanceId &id)
 
DataPatch::FlagsMap GetDataFlagsForPatching () const
 Returns data flags whose addresses align with those in the data patch.
 
void BuildReverseLookUp () const
 

Static Protected Member Functions

static DataFlagsPerEntity::IsValidEntityFunction GenerateValidEntityFunction (const SliceInstance *)
 

Protected Attributes

InstantiatedContainerm_instantiated
 Runtime only list of instantiated objects (serialization stores the delta m_dataPatch only)
 
EntityIdToEntityIdMap m_entityIdToBaseCache
 reverse lookup to m_baseToNewEntityIdMap, this is build on demand
 
EntityIdToEntityIdMap m_baseToNewEntityIdMap
 Map of old entityId to new.
 
DataPatch m_dataPatch
 Stored data patch which will take us from the dependent slice to the instantiated entities. Addresses are relative to the InstantiatedContainer.
 
DataFlagsPerEntity m_dataFlags
 For each entity, flags which may affect slice data inheritance. Addresses are relative to the entity, not the InstantiatedContainer.
 
SliceInstanceId m_instanceId
 Unique Id of the instance.
 
Entitym_metadataEntity
 

Friends

class SliceComponent
 

Detailed Description

Represents a slice instance in the current slice. For example if you refer to a base slice "lamppost" you can have multiple instances of that slice (all of them with custom overrides) in the current slice.

Member Function Documentation

◆ GetEntityIdMap()

const EntityIdToEntityIdMap & AZ::SliceComponent::SliceInstance::GetEntityIdMap ( ) const
inline

Returns a mapping of the EntityIDs from the base entities, to the new EntityIDs of the entities we will instantiate with this instance. @Note: This map may contain mappings to inactive entities.

◆ GetEntityIdMapForEdit()

EntityIdToEntityIdMap & AZ::SliceComponent::SliceInstance::GetEntityIdMapForEdit ( )
inline

Returns a non-const mapping of the EntityIDs from the base entities, to the new EntityIDs of the entities we will instantiate with this instance. Marks the reverse lookup table dirty by clearing it @Note: This map may contain mappings to inactive entities. @Note: Editing this map will impact future instantiations of this instance. From what entities it instantiates from base to the ids of the entities it instantiates

◆ GetEntityIdToBaseMap()

const EntityIdToEntityIdMap & AZ::SliceComponent::SliceInstance::GetEntityIdToBaseMap ( ) const
inline

Returns the reverse of GetEntityIdMap. The reverse table is built on demand. @Note: This map may contain mappings to inactive entities.

Member Data Documentation

◆ m_metadataEntity

Entity* AZ::SliceComponent::SliceInstance::m_metadataEntity
protected

Pointer to the clone metadata entity associated with the asset used to instantiate this class. Data is owned the m_instantiated member of this class.


The documentation for this class was generated from the following file: