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

#include <EntityContextBus.h>

Inherits AZ::EBusTraits.

Public Types

typedef EntityContextId BusIdType
 

Public Member Functions

virtual AZ::Entity * CreateEntity (const char *name)=0
 
virtual void AddEntity (AZ::Entity *entity)=0
 
virtual void ActivateEntity (AZ::EntityId entityId)=0
 
virtual void DeactivateEntity (AZ::EntityId entityId)=0
 
virtual bool DestroyEntity (AZ::Entity *entity)=0
 
virtual bool DestroyEntityById (AZ::EntityId entityId)=0
 
virtual AZ::Entity * CloneEntity (const AZ::Entity &sourceEntity)=0
 
virtual void ResetContext ()=0
 

Static Public Attributes

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

Detailed Description

Interface for AzFramework::EntityContextRequestBus, which is the EBus that makes requests to a given entity context. If you want to make requests to a specific entity context, such
as the game entity context, use the interface specific to that
context. If you want to make requests to multiple types of entity
contexts, use this interface.

Member Typedef Documentation

◆ BusIdType

Specifies that events are addressed by entity context ID.

Member Function Documentation

◆ ActivateEntity()

virtual void AzFramework::EntityContextRequests::ActivateEntity ( AZ::EntityId  entityId)
pure virtual

Activates an entity that is owned by the entity context.

Parameters
idThe ID of the entity to activate.

◆ AddEntity()

virtual void AzFramework::EntityContextRequests::AddEntity ( AZ::Entity *  entity)
pure virtual

Adds an entity to the entity context. This operation does not activate the entity by default. Derived classes might choose to set the entity to another state.

Parameters
entityA pointer to the entity to add.

◆ CloneEntity()

virtual AZ::Entity * AzFramework::EntityContextRequests::CloneEntity ( const AZ::Entity &  sourceEntity)
pure virtual

Creates a copy of the entity in the entity context. The cloned copy is assigned a unique entity ID.

Parameters
sourceEntityA reference to the entity to clone.
Returns
A pointer to the cloned copy of the entity. This operation can fail if serialization data fails to interpret the source entity.

◆ CreateEntity()

virtual AZ::Entity * AzFramework::EntityContextRequests::CreateEntity ( const char *  name)
pure virtual

Creates an entity and adds it to the entity context. This operation does not activate the entity by default.

Parameters
nameA name for the entity.
Returns
A pointer to a new entity. This operation succeeds unless the system is completely out of memory.

◆ DeactivateEntity()

virtual void AzFramework::EntityContextRequests::DeactivateEntity ( AZ::EntityId  entityId)
pure virtual

Deactivates an entity that is owned by the entity context.

Parameters
idThe ID of the entity to deactivate.

◆ DestroyEntity()

virtual bool AzFramework::EntityContextRequests::DestroyEntity ( AZ::Entity *  entity)
pure virtual

Removes an entity from the entity context and destroys the entity.

Parameters
entityA pointer to the entity to destroy.
Returns
If the entity context does not own the entity,
this returns false and does not destroy the entity.

◆ DestroyEntityById()

virtual bool AzFramework::EntityContextRequests::DestroyEntityById ( AZ::EntityId  entityId)
pure virtual

Removes an entity from the entity context and destroys the entity.

Parameters
entityIdThe ID of the entity to destroy.
Returns
If the entity context does not own the entity, this returns false and does not destroy the entity.

◆ ResetContext()

virtual void AzFramework::EntityContextRequests::ResetContext ( )
pure virtual

Clears the entity context by destroying all entities and prefab instances that the entity context owns.

Member Data Documentation

◆ AddressPolicy

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

Overrides the default AZ::EBusAddressPolicy so that the EBus has multiple addresses. Events that are addressed to an ID are received by all handlers that are connected to that ID.


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