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

#include <GameEntityContextBus.h>

Inherits AZ::EBusTraits.

Public Member Functions

virtual ~GameEntityContextRequests ()=default
 
virtual EntityContextId GetGameEntityContextId ()=0
 
virtual EntityContextGetGameEntityContextInstance ()=0
 
virtual AZ::Entity * CreateGameEntity (const char *)=0
 
virtual BehaviorEntity CreateGameEntityForBehaviorContext (const char *)=0
 
virtual void AddGameEntity (AZ::Entity *)=0
 
virtual void DestroyGameEntity (const AZ::EntityId &)=0
 
virtual void DestroyGameEntityAndDescendants (const AZ::EntityId &)=0
 
virtual void ActivateGameEntity (const AZ::EntityId &)=0
 
virtual void DeactivateGameEntity (const AZ::EntityId &)=0
 
virtual bool LoadFromStream (AZ::IO::GenericStream &, bool)=0
 
virtual void ResetGameContext ()=0
 
virtual AZStd::string GetEntityName (const AZ::EntityId &)=0
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 

Detailed Description

Interface for AzFramework::GameEntityContextRequestBus, which is
the EBus that makes requests to the game entity context. The game entity context holds gameplay entities, as opposed to system entities, editor entities, and so on.

Constructor & Destructor Documentation

◆ ~GameEntityContextRequests()

virtual AzFramework::GameEntityContextRequests::~GameEntityContextRequests ( )
virtualdefault

Destroys the instance of the class.

Member Function Documentation

◆ ActivateGameEntity()

virtual void AzFramework::GameEntityContextRequests::ActivateGameEntity ( const AZ::EntityId &  )
pure virtual

Activates the game entity.

Parameters
idThe ID of the entity to activate.

◆ AddGameEntity()

virtual void AzFramework::GameEntityContextRequests::AddGameEntity ( AZ::Entity *  )
pure virtual

Adds an existing entity to the game context.

Parameters
entityA pointer to the entity to add to the game context.

◆ CreateGameEntity()

virtual AZ::Entity * AzFramework::GameEntityContextRequests::CreateGameEntity ( const char *  )
pure virtual

Creates an entity in the game context.

Parameters
nameA name for the new entity.
Returns
A pointer to a new entity.

◆ CreateGameEntityForBehaviorContext()

virtual BehaviorEntity AzFramework::GameEntityContextRequests::CreateGameEntityForBehaviorContext ( const char *  )
pure virtual

Creates an entity in the game context.

Parameters
nameA name for the new entity.
Returns
An entity wrapper for use within the BehaviorContext.

◆ DeactivateGameEntity()

virtual void AzFramework::GameEntityContextRequests::DeactivateGameEntity ( const AZ::EntityId &  )
pure virtual

Deactivates the game entity.

Parameters
idThe ID of the entity to deactivate.

◆ DestroyGameEntity()

virtual void AzFramework::GameEntityContextRequests::DestroyGameEntity ( const AZ::EntityId &  )
pure virtual

Destroys an entity. The entity is immediately deactivated and will be destroyed on the next tick.

Parameters
idThe ID of the entity to destroy.

◆ DestroyGameEntityAndDescendants()

virtual void AzFramework::GameEntityContextRequests::DestroyGameEntityAndDescendants ( const AZ::EntityId &  )
pure virtual

Destroys an entity and all of its descendants. The entity and its descendants are immediately deactivated and will be destroyed on the next tick.

Parameters
idThe ID of the entity to destroy.

◆ GetEntityName()

virtual AZStd::string AzFramework::GameEntityContextRequests::GetEntityName ( const AZ::EntityId &  )
pure virtual

Returns the entity's name.

Parameters
idThe ID of the entity.
Returns
The name of the entity. Returns an empty string if the entity cannot be found.

◆ GetGameEntityContextId()

virtual EntityContextId AzFramework::GameEntityContextRequests::GetGameEntityContextId ( )
pure virtual

Gets the ID of the game entity context.

Returns
The ID of the game entity context.

◆ LoadFromStream()

virtual bool AzFramework::GameEntityContextRequests::LoadFromStream ( AZ::IO::GenericStream &  ,
bool   
)
pure virtual

Loads game entities from a stream.

Parameters
streamThe stream to load the entities from.
remapIdsUse true to remap the entity IDs after the stream is loaded.
Returns
True if the stream successfully loaded. Otherwise, false. This operation
can fail if the source file is corrupt or the data could not be up-converted.

◆ ResetGameContext()

virtual void AzFramework::GameEntityContextRequests::ResetGameContext ( )
pure virtual

Completely resets the game context. This includes deleting all prefabs and entities.

Member Data Documentation

◆ HandlerPolicy

const AZ::EBusHandlerPolicy AzFramework::GameEntityContextRequests::HandlerPolicy = AZ::EBusHandlerPolicy::Single
static

Overrides the default AZ::EBusTraits handler policy so that this EBus supports a single handler at each address. This EBus has only
one handler because it uses the default AZ::EBusTraits address policy, and that policy specifies that the EBus has only one address.


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