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::ContainerEntityInterface Class Referenceabstract

#include <ContainerEntityInterface.h>

Inherited by AzToolsFramework::ContainerEntitySystemComponent [private].

Public Member Functions

 AZ_RTTI (ContainerEntityInterface, "{0A877C3A-726C-4FD2-BAFE-A2B9F1DE78E4}")
 
virtual ContainerEntityOperationResult RegisterEntityAsContainer (AZ::EntityId entityId)=0
 
virtual ContainerEntityOperationResult UnregisterEntityAsContainer (AZ::EntityId entityId)=0
 
virtual bool IsContainer (AZ::EntityId entityId) const =0
 Returns whether the entity id provided is registered as a container.
 
virtual ContainerEntityOperationResult SetContainerOpen (AZ::EntityId entityId, bool open)=0
 
virtual bool IsContainerOpen (AZ::EntityId entityId) const =0
 
virtual AZ::EntityId FindHighestSelectableEntity (AZ::EntityId entityId) const =0
 
virtual void RefreshAllContainerEntities (AzFramework::EntityContextId entityContextId) const =0
 
virtual ContainerEntityOperationResult Clear (AzFramework::EntityContextId entityContextId)=0
 
virtual bool IsUnderClosedContainerEntity (AZ::EntityId entityId) const =0
 Returns true if one of the ancestors of entityId is a closed container entity.
 

Detailed Description

ContainerEntityInterface An entity registered as Container is just like a regular entity when open. If its state is changed to closed, all descendants of the entity will be treated as part of the entity itself. Selecting any descendant will result in the container being selected, and descendants will be hidden until the container is opened.

Member Function Documentation

◆ Clear()

virtual ContainerEntityOperationResult AzToolsFramework::ContainerEntityInterface::Clear ( AzFramework::EntityContextId  entityContextId)
pure virtual

Clears all open state information for Container Entities for the EntityContextId provided. Used when context is switched, for example in the case of a new root prefab being loaded in place of an old one.

Note
Clear is meant to be called when no container is registered for the context provided.
Returns
An error message if any container was registered for the context, success otherwise.

Implemented in AzToolsFramework::ContainerEntitySystemComponent.

◆ FindHighestSelectableEntity()

virtual AZ::EntityId AzToolsFramework::ContainerEntityInterface::FindHighestSelectableEntity ( AZ::EntityId  entityId) const
pure virtual

Detects if one of the ancestors of entityId is a closed container entity.

Returns
The highest closed entity container id if any, or entityId otherwise.

Implemented in AzToolsFramework::ContainerEntitySystemComponent.

◆ IsContainer()

virtual bool AzToolsFramework::ContainerEntityInterface::IsContainer ( AZ::EntityId  entityId) const
pure virtual

Returns whether the entity id provided is registered as a container.

Implemented in AzToolsFramework::ContainerEntitySystemComponent.

◆ IsContainerOpen()

virtual bool AzToolsFramework::ContainerEntityInterface::IsContainerOpen ( AZ::EntityId  entityId) const
pure virtual

If the entity id provided is registered as a container, it returns whether it's open.

Note
the default value for non-containers is true, so this function can be called without verifying whether the entityId is registered as a container beforehand, since the container's open behavior is exactly the same as the one of a regular entity.
Returns
False if the entityId is registered as a container, and its state is closed. True otherwise.

Implemented in AzToolsFramework::ContainerEntitySystemComponent.

◆ IsUnderClosedContainerEntity()

virtual bool AzToolsFramework::ContainerEntityInterface::IsUnderClosedContainerEntity ( AZ::EntityId  entityId) const
pure virtual

Returns true if one of the ancestors of entityId is a closed container entity.

Implemented in AzToolsFramework::ContainerEntitySystemComponent.

◆ RefreshAllContainerEntities()

virtual void AzToolsFramework::ContainerEntityInterface::RefreshAllContainerEntities ( AzFramework::EntityContextId  entityContextId) const
pure virtual

Triggers the OnContainerEntityStatusChanged notifications for all registered containers, allowing listeners to update correctly.

Implemented in AzToolsFramework::ContainerEntitySystemComponent.

◆ RegisterEntityAsContainer()

virtual ContainerEntityOperationResult AzToolsFramework::ContainerEntityInterface::RegisterEntityAsContainer ( AZ::EntityId  entityId)
pure virtual

Registers the entity as a container. The container will be closed by default.

Parameters
entityIdThe entityId that will be registered as a container.

Implemented in AzToolsFramework::ContainerEntitySystemComponent.

◆ SetContainerOpen()

virtual ContainerEntityOperationResult AzToolsFramework::ContainerEntityInterface::SetContainerOpen ( AZ::EntityId  entityId,
bool  open 
)
pure virtual

Sets the open state of the container entity provided.

Parameters
entityIdThe entityId whose open state will be set.
openTrue if the container should be opened, false if it should be closed.
Returns
An error message if the operation was invalid, success otherwise.

Implemented in AzToolsFramework::ContainerEntitySystemComponent.

◆ UnregisterEntityAsContainer()

virtual ContainerEntityOperationResult AzToolsFramework::ContainerEntityInterface::UnregisterEntityAsContainer ( AZ::EntityId  entityId)
pure virtual

Unregisters the entity as a container. The system will retain the closed state in case the entity is registered again later, but if queried the entity will no longer behave as a container.

Parameters
entityIdThe entityId that will be unregistered as a container.

Implemented in AzToolsFramework::ContainerEntitySystemComponent.


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