Open 3D Engine AzFramework 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.
AzFramework::SliceEntityOwnershipServiceRequests Class Referenceabstract

Inherits AZ::EBusTraits.

Public Types

using BusIdType = EntityContextId
 

Public Member Functions

virtual AZ::Data::AssetId CurrentlyInstantiatingSlice ()=0
 
virtual bool HandleRootEntityReloadedFromStream (AZ::Entity *rootEntity, bool remapIds, AZ::SliceComponent::EntityIdToEntityIdMap *idRemapTable=nullptr)=0
 
virtual AZ::SliceComponent * GetRootSlice ()=0
 
virtual const AZ::SliceComponent::EntityIdToEntityIdMap & GetLoadedEntityIdMap ()=0
 
virtual AZ::EntityId FindLoadedEntityIdMapping (const AZ::EntityId &staticId) const =0
 
virtual SliceInstantiationTicket InstantiateSlice (const AZ::Data::Asset< AZ::Data::AssetData > &asset, const AZ::IdUtils::Remapper< AZ::EntityId >::IdMapper &customIdMapper=nullptr, const AZ::Data::AssetFilterCB &assetLoadFilter=nullptr)=0
 
virtual AZ::SliceComponent::SliceInstanceAddress CloneSliceInstance (AZ::SliceComponent::SliceInstanceAddress sourceInstance, AZ::SliceComponent::EntityIdToEntityIdMap &sourceToCloneEntityIdMap)=0
 
virtual void CancelSliceInstantiation (const SliceInstantiationTicket &ticket)=0
 
virtual SliceInstantiationTicket GenerateSliceInstantiationTicket ()=0
 
virtual void SetIsDynamic (bool isDynamic)=0
 
virtual const RootSliceAsset & GetRootAsset () const =0
 

Static Public Attributes

static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById
 

Member Function Documentation

◆ CancelSliceInstantiation()

virtual void AzFramework::SliceEntityOwnershipServiceRequests::CancelSliceInstantiation ( const SliceInstantiationTicket ticket)
pure virtual

Cancels the asynchronous instantiation of a slice.

Parameters
SliceInstantiationTicketThe ticket identifies the asynchronous slice instantiation request.

◆ CloneSliceInstance()

virtual AZ::SliceComponent::SliceInstanceAddress AzFramework::SliceEntityOwnershipServiceRequests::CloneSliceInstance ( AZ::SliceComponent::SliceInstanceAddress  sourceInstance,
AZ::SliceComponent::EntityIdToEntityIdMap &  sourceToCloneEntityIdMap 
)
pure virtual

Clones an existing slice instance in the entity ownership service. New instance is immediately returned. This function doesn't automatically add new instance to the entity ownership service. Callers are responsible for that.

Parameters
sourceInstanceThe source instance to be cloned
sourceToCloneEntityIdMap[out] The map between source entity ids and clone entity ids
Returns
new slice address. A null slice address will be returned if cloning fails (.first==nullptr, .second==nullptr).

◆ CurrentlyInstantiatingSlice()

virtual AZ::Data::AssetId AzFramework::SliceEntityOwnershipServiceRequests::CurrentlyInstantiatingSlice ( )
pure virtual

Gets the Asset ID of the currently instantiating slice. If no slice is currently being instantiated, it returns an invalid ID

Returns
The Asset ID of the slice currently being instantiated.

◆ FindLoadedEntityIdMapping()

virtual AZ::EntityId AzFramework::SliceEntityOwnershipServiceRequests::FindLoadedEntityIdMapping ( const AZ::EntityId &  staticId) const
pure virtual

Returns the remapped id of a stream-loaded EntityId if remapping was performed.

Returns
The remapped EntityId

◆ GenerateSliceInstantiationTicket()

virtual SliceInstantiationTicket AzFramework::SliceEntityOwnershipServiceRequests::GenerateSliceInstantiationTicket ( )
pure virtual

Generates a ticket that can be used for tracking asynchronous slice instantiations.

Returns
SliceInstantiationTicket

◆ GetLoadedEntityIdMap()

virtual const AZ::SliceComponent::EntityIdToEntityIdMap & AzFramework::SliceEntityOwnershipServiceRequests::GetLoadedEntityIdMap ( )
pure virtual

Returns a mapping of stream-loaded entity IDs to remapped entity IDs,if remapping was performed. If the stream was loaded without remapping enabled, the map will be empty.

Returns
A mapping of entity IDs loaded from a stream to remapped values.

◆ HandleRootEntityReloadedFromStream()

virtual bool AzFramework::SliceEntityOwnershipServiceRequests::HandleRootEntityReloadedFromStream ( AZ::Entity *  rootEntity,
bool  remapIds,
AZ::SliceComponent::EntityIdToEntityIdMap *  idRemapTable = nullptr 
)
pure virtual

Initialize this entity ownership service with a newly loaded root slice.

Parameters
rootEntitythe rootEntity which has been loaded
remapIdsif true, entity Ids will be remapped post-load
idRemapTableif remapIds is true, the provided table is filled with a map of original ids to new ids
Returns
whether reading root entity was successful or not

◆ InstantiateSlice()

virtual SliceInstantiationTicket AzFramework::SliceEntityOwnershipServiceRequests::InstantiateSlice ( const AZ::Data::Asset< AZ::Data::AssetData > &  asset,
const AZ::IdUtils::Remapper< AZ::EntityId >::IdMapper &  customIdMapper = nullptr,
const AZ::Data::AssetFilterCB &  assetLoadFilter = nullptr 
)
pure virtual

Instantiate a slice asset in the entity ownership service. Listen for the OnSliceInstantiated() / OnSliceInstantiationFailed() events for details about the resulting entities.

Parameters
assetslice asset to instantiate.
customIdMapperoptional Id map callback to allow caller to customize entity Id generation.
assetLoadFilterCBoptional asset load filter callback. This is only necessary when heavily customizing asset loading, as it can allow deferral of dependent asset loading.
returnslice instantiation ticket.

◆ SetIsDynamic()

virtual void AzFramework::SliceEntityOwnershipServiceRequests::SetIsDynamic ( bool  isDynamic)
pure virtual

Enables the root slice to be a dynamic slice.

Parameters
isDynamic

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