Menu
Lumberyard
C++ API Reference (Version 1.10)

AzFramework::GameEntityContextRequests Class Reference

Open 3D Engine (O3DE), the successor to Lumberyard, is now available in Developer Preview. Download O3DE or visit the AWS Game Tech blog to learn more.

Interface for AzFramework::GameEntityContextRequestBus , which is the EBus that makes requests to the game entity context. More...

Inherits AZ::EBusTraits .

Public Member Functions

virtual ~GameEntityContextRequests ()=default
Destroys the instance of the class. More...
virtual EntityContextId GetGameEntityContextId ()
Gets the ID of the game entity context. More...
virtual AZ::Entity * CreateGameEntity (const char *)
Creates an entity in the game context. More...
virtual void AddGameEntity ( AZ::Entity *)
Adds an existing entity to the game context. More...
virtual void DestroyGameEntity (const AZ::EntityId &)
Destroys an entity. More...
virtual void DestroyGameEntityAndDescendants (const AZ::EntityId &)
Destroys an entity and all of its descendants. More...
virtual void ActivateGameEntity (const AZ::EntityId &)
Activates the game entity. More...
virtual void DeactivateGameEntity (const AZ::EntityId &)
Deactivates the game entity. More...
virtual bool DestroyDynamicSliceByEntity (const AZ::EntityId &)
Destroys an entire dynamic slice instance given the ID of any entity within the slice. More...
virtual SliceInstantiationTicket InstantiateDynamicSlice (const AZ::Data::Asset< AZ::Data::AssetData > &, const AZ::Transform &, const AZ::EntityUtils::EntityIdMapper &)
Instantiates a dynamic slice asynchronously. More...
virtual bool LoadFromStream (AZ::IO::GenericStream &, bool)
Loads game entities from a stream. More...
virtual void ResetGameContext ()
Completely resets the game context. More...
virtual void MarkEntityForNoActivation ( AZ::EntityId )
Specifies that a given entity should not be activated by default after it is created. More...
virtual AZStd::string GetEntityName (const AZ::EntityId &)
Returns the entity's name. More...

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy
Overrides the default AZ::EBusTraits handler policy so that this EBus supports a single handler at each address. 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

- Public Types inherited from AZ::EBusTraits
using AllocatorType = AZStd::allocator
Allocator used by the EBus . More...
using BusIdType = NullBusId
The type of ID that is used to address the EBus . More...
using BusIdOrderCompare = NullBusIdCompare
Sorting function for EBus address IDs. More...
using BusHandlerOrderCompare = BusHandlerCompareDefault
Sorting function for EBus event handlers. More...
using MutexType = NullMutex
Locking primitive that is used when connecting handlers to the EBus or executing events. More...
using EventQueueMutexType = NullMutex
Locking primitive that is used when adding and removing events from the queue. More...
template<class Bus >
using ConnectionPolicy = EBusConnectionPolicy < Bus >
Enables custom logic to run when a handler connects or disconnects from the EBus . More...
template<class Context >
using StoragePolicy = EBusEnvironmentStoragePolicy < Context >
Specifies where EBus data is stored. More...
template<class Bus >
using RouterPolicy = EBusRouterPolicy< Bus >
Controls the flow of EBus events. More...
- Protected Member Functions inherited from AZ::EBusTraits
~EBusTraits ()=default
A destructor. More...

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 ( )
virtual default

Destroys the instance of the class.

Member Function Documentation

ActivateGameEntity()

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

Activates the game entity.

Parameters
id The ID of the entity to activate.

AddGameEntity()

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

Adds an existing entity to the game context.

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

CreateGameEntity()

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

Creates an entity in the game context.

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

DeactivateGameEntity()

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

Deactivates the game entity.

Parameters
id The ID of the entity to deactivate.

DestroyDynamicSliceByEntity()

virtual bool AzFramework::GameEntityContextRequests::DestroyDynamicSliceByEntity ( const AZ::EntityId & )
inline virtual

Destroys an entire dynamic slice instance given the ID of any entity within the slice.

Parameters
id The ID of the entity whose dynamic slice instance you want to destroy.
Returns
True if the dynamic slice instance was successfully destroyed. Otherwise, false.

DestroyGameEntity()

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

Destroys an entity.

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

Parameters
id The ID of the entity to destroy.

DestroyGameEntityAndDescendants()

virtual void AzFramework::GameEntityContextRequests::DestroyGameEntityAndDescendants ( const AZ::EntityId & )
inline 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
id The ID of the entity to destroy.

GetEntityName()

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

Returns the entity's name.

Parameters
id The 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 ( )
inline virtual

Gets the ID of the game entity context.

Returns
The ID of the game entity context.

InstantiateDynamicSlice()

virtual SliceInstantiationTicket AzFramework::GameEntityContextRequests::InstantiateDynamicSlice ( const AZ::Data::Asset< AZ::Data::AssetData > & ,
const AZ::Transform & ,
const AZ::EntityUtils::EntityIdMapper &
)
inline virtual

Instantiates a dynamic slice asynchronously.

Parameters
sliceAsset A reference to the slice asset data.
worldTransform A reference to the world transform to apply to the slice.
customIdMapper An ID mapping function that is used when instantiating the slice.
Returns
A ticket that identifies the slice instantiation request. Callers can immediately subscribe to the AzFramework::SliceInstantiationResultBus for this ticket to receive results for this request.

LoadFromStream()

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

Loads game entities from a stream.

Parameters
stream The root slice.
remapIds Use 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.

MarkEntityForNoActivation()

virtual void AzFramework::GameEntityContextRequests::MarkEntityForNoActivation ( AZ::EntityId )
inline virtual

Specifies that a given entity should not be activated by default after it is created.

Parameters
entityId The entity that should not be activated by default.

ResetGameContext()

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

Completely resets the game context.

This includes deleting all slices and entities.

Member Data Documentation

HandlerPolicy

const AZ::EBusHandlerPolicy AzFramework::GameEntityContextRequests::HandlerPolicy
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: