Menu
Lumberyard
C++ API Reference (Version 1.10)

AzFramework::EntityContextRequests Class Referenceabstract

Interface for AzFramework::EntityContextRequestBus, which is the EBus that makes requests to a given entity context. More...

Inherits AZ::EBusTraits.

Public Types

typedef  BusIdType
 Specifies that events are addressed by entity context ID. More...
 
- Public Types inherited from AZ::EBusTraits
using AllocatorType
 Allocator used by the EBus. More...
 
using BusIdType
 The type of ID that is used to address the EBus. More...
 
using BusIdOrderCompare
 Sorting function for EBus address IDs. More...
 
using BusHandlerOrderCompare
 Sorting function for EBus event handlers. More...
 
using MutexType
 Locking primitive that is used when connecting handlers to the EBus or executing events. More...
 
using EventQueueMutexType
 Locking primitive that is used when adding and removing events from the queue. More...
 
using ConnectionPolicy
 Enables custom logic to run when a handler connects or disconnects from the EBus. More...
 
using StoragePolicy
 Specifies where EBus data is stored. More...
 
using RouterPolicy
 Controls the flow of EBus events. More...
 

Public Member Functions

virtual AZ::SliceComponent * GetRootSlice ()=0
 Retrieves the root slice of the entity context. More...
 
virtual AZ::EntityCreateEntity (const char *name)=0
 Creates an entity and adds it to the root slice of the entity context. More...
 
virtual void AddEntity (AZ::Entity *entity)=0
 Adds an entity to the root slice of the entity context. More...
 
virtual bool DestroyEntity (AZ::Entity *entity)=0
 Removes an entity from the entity context's root slice and destroys the entity. More...
 
virtual bool DestroyEntity (AZ::EntityId entityId)=0
 Removes an entity from the entity context's root slice and destroys the entity. More...
 
virtual AZ::EntityCloneEntity (const AZ::Entity &sourceEntity)=0
 Creates a copy of the entity in the root slice of the entity context. More...
 
virtual const AZ::SliceComponent::EntityIdToEntityIdMap & GetLoadedEntityIdMap ()=0
 Returns a mapping of stream-loaded entity IDs to remapped entity IDs, if remapping was performed. More...
 
virtual void ResetContext ()=0
 Clears the entity context by destroying all entities and slice instances that the entity context owns. More...
 

Static Public Attributes

static const AZ::EBusAddressPolicy AddressPolicy
 Overrides the default AZ::EBusAddressPolicy so that the EBus has multiple addresses. More...
 
- Static Public Attributes inherited from AZ::EBusTraits
static const EBusHandlerPolicy HandlerPolicy
 Defines how many handlers can connect to an address on the EBus and the order in which handlers at each address receive events. More...
 
static const EBusAddressPolicy AddressPolicy
 Defines how many addresses exist on the EBus. More...
 
static const bool EnableEventQueue
 Specifies whether the EBus supports an event queue. More...
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::EBusTraits
 ~EBusTraits ()=default
 A destructor. More...
 

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

◆ AddEntity()

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

Adds an entity to the root slice of 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 root slice of 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 root slice of the entity context.

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

◆ DestroyEntity() [1/2]

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

Removes an entity from the entity context's root slice 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.

◆ DestroyEntity() [2/2]

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

Removes an entity from the entity context's root slice 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.

◆ GetLoadedEntityIdMap()

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

Returns a mapping of stream-loaded entity IDs to remapped entity IDs, if remapping was performed.

Returns
A mapping of entity IDs loaded from a stream to remapped values. If the stream was loaded without remapping enabled, the map will be empty.

◆ GetRootSlice()

virtual AZ::SliceComponent* AzFramework::EntityContextRequests::GetRootSlice ( )
pure virtual

Retrieves the root slice of the entity context.

Each entity context has a root slice, which contains all the entities within the context.

Returns
A pointer to the root slice.

◆ ResetContext()

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

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

Member Data Documentation

◆ AddressPolicy

const AZ::EBusAddressPolicy AzFramework::EntityContextRequests::AddressPolicy
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: