Open 3D Engine AzToolsFramework 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.
AzToolsFramework::SliceMetadataEntityContextComponent Class Reference

#include <SliceMetadataEntityContextComponent.h>

Inherits AZ::Component, AzFramework::EntityContext, AZ::SliceInstanceNotificationBus::Handler, SliceMetadataEntityContextRequestBus::Handler, AzToolsFramework::ToolsApplicationEvents::Bus::Handler, and AZ::SliceMetadataInfoNotificationBus::MultiHandler.

Public Member Functions

 AZ_COMPONENT (SliceMetadataEntityContextComponent, "{F53BF27D-9A95-41CC-BA2F-6496F9BC0C6B}")
 
 SliceMetadataEntityContextComponent ()
 
 ~SliceMetadataEntityContextComponent () override=default
 
void Activate () override
 
void Deactivate () override
 
AzFramework::EntityContextId GetSliceMetadataEntityContextId () override
 
void ResetContext () override
 
void GetRequiredComponentTypes (AZ::ComponentTypeList &required) override
 
bool IsSliceMetadataEntity (const AZ::EntityId entityId) override
 
AZ::Entity * GetMetadataEntity (const AZ::EntityId entityId) override
 
AZ::EntityId GetMetadataEntityIdFromEditorEntity (const AZ::EntityId editorEntityId) override
 
AZ::EntityId GetMetadataEntityIdFromSliceAddress (const AZ::SliceComponent::SliceInstanceAddress &address) override
 
void AddMetadataEntityToContext (const AZ::SliceComponent::SliceInstanceAddress &, AZ::Entity &entity) override
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 
static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 
static void GetDependentServices (AZ::ComponentDescriptor::DependencyArrayType &dependent)
 

Protected Member Functions

void OnMetadataEntityCreated (const AZ::SliceComponent::SliceInstanceAddress &sliceAdress, AZ::Entity &entity) override
 
void OnMetadataEntityDestroyed (AZ::EntityId entityId) override
 
void OnMetadataDependenciesRemoved () override
 
void AddRequiredComponents (AZ::Entity &entity)
 
void RemoveMetadataEntityFromContext (AZ::EntityId entityId)
 
 SliceMetadataEntityContextComponent (const SliceMetadataEntityContextComponent &)=delete
 
SliceMetadataEntityContextComponentoperator= (const SliceMetadataEntityContextComponent &)=delete
 

Protected Attributes

AZ::ComponentTypeList m_requiredSliceMetadataComponentTypes
 
AZStd::unordered_map< AZ::EntityId, AZ::EntityId > m_editorEntityToMetadataEntityMap
 
AZStd::unordered_map< AZ::SliceComponent::SliceInstanceAddress, AZ::EntityId > m_sliceAddressToRootMetadataMap
 
AZStd::unordered_map< AZ::EntityId, AZ::Entity * > m_metadataEntityByIdMap
 

Detailed Description

System component responsible for owning the edit-time slice metadata entity context

The slice metadata entity context that creates and manages entities associated with slice instances. The components on these entities collect, pre-compute, and store useful metadata associated with slices. Unlike existing entity contexts, it doesn't not provide an interface for managing its contents and does not make use of the root slice provided by the base entity context.

Note
This class may be moved to the Framework for use in the game runtime.

Constructor & Destructor Documentation

◆ SliceMetadataEntityContextComponent()

AzToolsFramework::SliceMetadataEntityContextComponent::SliceMetadataEntityContextComponent ( )

Default Constructor - Establishes required components for entities belonging to the context

◆ ~SliceMetadataEntityContextComponent()

AzToolsFramework::SliceMetadataEntityContextComponent::~SliceMetadataEntityContextComponent ( )
overridedefault

Default Destructor

Member Function Documentation

◆ AddRequiredComponents()

void AzToolsFramework::SliceMetadataEntityContextComponent::AddRequiredComponents ( AZ::Entity &  entity)
protected

This context requires that entities added to it have certain components. This function will add those component to any entity passed to it, if needed.

Parameters
entityAny component entity that's going to belong to this context.

◆ GetDependentServices()

static void AzToolsFramework::SliceMetadataEntityContextComponent::GetDependentServices ( AZ::ComponentDescriptor::DependencyArrayType &  dependent)
static

Component Descriptor - Dependent Services

Parameters
dependentAn array to fill out with all the services this component depends on

◆ GetIncompatibleServices()

static void AzToolsFramework::SliceMetadataEntityContextComponent::GetIncompatibleServices ( AZ::ComponentDescriptor::DependencyArrayType &  incompatible)
static

Component Descriptor - Incompatible Services

Parameters
incompatibleAn array to fill out with all the services this component is incompatible with

◆ GetProvidedServices()

static void AzToolsFramework::SliceMetadataEntityContextComponent::GetProvidedServices ( AZ::ComponentDescriptor::DependencyArrayType &  provided)
static

Component Descriptor - Provided Services

Parameters
providedAn array to fill out with all the services this component provides

◆ Reflect()

static void AzToolsFramework::SliceMetadataEntityContextComponent::Reflect ( AZ::ReflectContext *  context)
static

Component Descriptor - Component Reflection

Parameters
contextA reflection context

◆ RemoveMetadataEntityFromContext()

void AzToolsFramework::SliceMetadataEntityContextComponent::RemoveMetadataEntityFromContext ( AZ::EntityId  entityId)
protected

Removes the given entity from the context and cleans up the quick-reference maps If the entity is not part of this context, the function does nothing.

Parameters
entityIdThe ID of the entity to remove from the context.
Note
This does not destroy the entity or remove it from the component application.

Member Data Documentation

◆ m_editorEntityToMetadataEntityMap

AZStd::unordered_map<AZ::EntityId, AZ::EntityId> AzToolsFramework::SliceMetadataEntityContextComponent::m_editorEntityToMetadataEntityMap
protected

A quick lookup map for finding the metadata entity associated with an editor entity.

◆ m_metadataEntityByIdMap

AZStd::unordered_map<AZ::EntityId, AZ::Entity*> AzToolsFramework::SliceMetadataEntityContextComponent::m_metadataEntityByIdMap
protected

All of the entities owned by this context, keyed by their IDs.

◆ m_requiredSliceMetadataComponentTypes

AZ::ComponentTypeList AzToolsFramework::SliceMetadataEntityContextComponent::m_requiredSliceMetadataComponentTypes
protected

The list of components that entities in this context are required to have.

◆ m_sliceAddressToRootMetadataMap

AZStd::unordered_map<AZ::SliceComponent::SliceInstanceAddress, AZ::EntityId> AzToolsFramework::SliceMetadataEntityContextComponent::m_sliceAddressToRootMetadataMap
protected

A quick lookup map for finding the metadata entity associated with the given slice instance.


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