#include <SpawnableEntitiesInterface.h>
Public Member Functions | |
AZ_RTTI (AzFramework::SpawnableEntitiesDefinition, "{A9ED3F1F-4D69-4182-B0CD-EB561EEA7068}") | |
virtual void | SpawnAllEntities (EntitySpawnTicket &ticket, SpawnAllEntitiesOptionalArgs optionalArgs={})=0 |
virtual void | SpawnEntities (EntitySpawnTicket &ticket, AZStd::vector< uint32_t > entityIndices, SpawnEntitiesOptionalArgs optionalArgs={})=0 |
virtual void | DespawnAllEntities (EntitySpawnTicket &ticket, DespawnAllEntitiesOptionalArgs optionalArgs={})=0 |
virtual void | DespawnEntity (AZ::EntityId entityId, EntitySpawnTicket &ticket, DespawnEntityOptionalArgs optionalArgs={})=0 |
virtual void | RetrieveTicket (EntitySpawnTicket::Id ticketId, RetrieveEntitySpawnTicketCallback callback, RetrieveTicketOptionalArgs optionalArgs={})=0 |
virtual void | ReloadSpawnable (EntitySpawnTicket &ticket, AZ::Data::Asset< Spawnable > spawnable, ReloadSpawnableOptionalArgs optionalArgs={})=0 |
virtual void | UpdateEntityAliasTypes (EntitySpawnTicket &ticket, AZStd::vector< EntityAliasTypeChange > updatedAliases, UpdateEntityAliasTypesOptionalArgs optionalArgs={})=0 |
virtual void | ListEntities (EntitySpawnTicket &ticket, ListEntitiesCallback listCallback, ListEntitiesOptionalArgs optionalArgs={})=0 |
virtual void | ListIndicesAndEntities (EntitySpawnTicket &ticket, ListIndicesEntitiesCallback listCallback, ListEntitiesOptionalArgs optionalArgs={})=0 |
virtual void | ClaimEntities (EntitySpawnTicket &ticket, ClaimEntitiesCallback listCallback, ClaimEntitiesOptionalArgs optionalArgs={})=0 |
virtual void | Barrier (EntitySpawnTicket &ticket, BarrierCallback completionCallback, BarrierOptionalArgs optionalArgs={})=0 |
virtual void | LoadBarrier (EntitySpawnTicket &ticket, BarrierCallback completionCallback, LoadBarrierOptionalArgs optionalArgs={})=0 |
Protected Member Functions | |
virtual void * | CreateTicket (AZ::Data::Asset< Spawnable > &&spawnable)=0 |
virtual void | IncrementTicketReference (void *ticket)=0 |
virtual void | DecrementTicketReference (void *ticket)=0 |
virtual EntitySpawnTicket::Id | GetTicketId (void *ticket)=0 |
virtual const AZ::Data::Asset< Spawnable > & | GetSpawnableOnTicket (void *ticket)=0 |
Static Protected Member Functions | |
template<typename T > | |
static T & | GetTicketPayload (EntitySpawnTicket &ticket) |
template<typename T > | |
static const T & | GetTicketPayload (const EntitySpawnTicket &ticket) |
template<typename T > | |
static T * | GetTicketPayload (EntitySpawnTicket *ticket) |
template<typename T > | |
static const T * | GetTicketPayload (const EntitySpawnTicket *ticket) |
Friends | |
class | EntitySpawnTicket |
Interface definition to (de)spawn entities from a spawnable into the game world.
While the callbacks of the individual calls are being processed they will block processing any other request. Callbacks can be issued from threads other than the one that issued the call, including the main thread.
Calls on the same ticket are guaranteed to be executed in the order they are issued. Note that when issuing requests from multiple threads on the same ticket the order in which the requests are assigned to the ticket is not guaranteed.
Most calls have a priority with values that range from 0 (highest priority) to 255 (lowest priority). The implementation of this interface may choose to use priority lanes which doesn't guarantee that higher priority requests happen before lower priority requests if they don't pass the priority lane threshold. Priority lanes and their thresholds are implementation specific and may differ between platforms. Note that if a call happened on a ticket with lower priority followed by a one with a higher priority the first lower priority call will still need to complete before the second higher priority call can be executed and the priority of the first call will not be updated.
|
pure virtual |
Blocks until all operations made on the provided ticket before the barrier call have completed.
ticket | The ticket to monitor. |
completionCallback | Required callback that will be called as soon as the barrier has been reached. |
optionalArgs | Optional additional arguments, see BarrierOptionalArgs. |
|
pure virtual |
Claim all entities that are spawned using this ticket. Ownership of the entities is transferred from the ticket to the caller through the callback. After this call the ticket will have no entities associated with it. The caller of this function will need to manage the entities after this call.
ticket | Only the entities associated with this ticket will be released. |
listCallback | Required callback that will be called to transfer the entities through. |
optionalArgs | Optional additional arguments, see ClaimEntitiesOptionalArgs. |
|
pure virtual |
Removes all entities in the provided list from the environment.
ticket | The ticket previously used to spawn entities with. |
optionalArgs | Optional additional arguments, see DespawnAllEntitiesOptionalArgs. |
|
pure virtual |
Removes the entity with the provided id from the spawned list of entities.
entityId | the id of entity to despawn. |
ticket | The ticket previously used to spawn entities with. |
optionalArgs | Optional additional arguments, see DespawnEntityOptionalArgs. |
|
pure virtual |
List all entities that are spawned using this ticket.
ticket | Only the entities associated with this ticket will be listed. |
listCallback | Required callback that will be called to list the entities on. |
optionalArgs | Optional additional arguments, see ListEntitiesOptionalArgs. |
|
pure virtual |
List all entities that are spawned using this ticket with their spawnable index. Spawnables contain a flat list of entities, which are used as templates to spawn entities from. For every spawned entity the index of the entity in the spawnable that was used as a template is stored. This version of ListEntities will return both the entities and this index. The index can be used with SpawnEntities to create the same entities again. Note that the same index may appear multiple times as there are no restriction on how many instance of a specific entity can be created.
ticket | Only the entities associated with this ticket will be listed. |
listCallback | Required callback that will be called to list the entities and indices on. |
optionalArgs | Optional additional arguments, see ListEntitiesOptionalArgs. |
|
pure virtual |
Blocks until the spawnable is loaded and all operations made on the provided ticket before the barrier call have completed.
ticket | The ticket to monitor. |
completionCallback | Required callback that will be called as soon as the barrier has been reached. |
optionalArgs | Optional additional arguments, see BarrierOptionalArgs. |
|
pure virtual |
Removes all entities in the provided list from the environment and reconstructs the entities from the provided spawnable.
ticket | Holds the information on the entities to reload. |
priority | The priority at which this call will be executed. |
spawnable | The spawnable that will replace the existing spawnable. Both need to have the same asset id. |
optionalArgs | Optional additional arguments, see ReloadSpawnableOptionalArgs. |
|
pure virtual |
Gets the EntitySpawnTicket associated with the entitySpawnTicketId.
entitySpawnTicketId | the id of EntitySpawnTicket to get. |
callback | The callback to execute upon retrieving the ticket. |
|
pure virtual |
Spawn instances of all entities in the spawnable.
ticket | Stores the results of the call. Use this ticket to spawn additional entities or to despawn them. |
optionalArgs | Optional additional arguments, see SpawnAllEntitiesOptionalArgs. |
|
pure virtual |
Spawn instances of some entities in the spawnable.
ticket | Stores the results of the call. Use this ticket to spawn additional entities or to despawn them. |
priority | The priority at which this call will be executed. |
entityIndices | The indices into the template entities stored in the spawnable that will be used to spawn entities from. |
optionalArgs | Optional additional arguments, see SpawnEntitiesOptionalArgs. |
|
pure virtual |
Allows updating the entity alias on a spawnable. This allows the spawning behavior for all entities spawned from the used spawnable to be changed and is not restricted to this ticket alone.
ticket | Holds the information for the spawnable. |
updateAliases | An array of index and alias type values used to update the entity alias list. |
optionalArgs | Optional additional arguments, see UpdateEntityAliasTypesOptionalArgs. |