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::EntitySpawnTicket Class Referencefinal

#include <SpawnableEntitiesInterface.h>

Public Types

using Id = uint32_t
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (AzFramework::EntitySpawnTicket, AZ::SystemAllocator)
 
 AZ_TYPE_INFO (AzFramework::EntitySpawnTicket, "{BA62FF9A-A01E-4FEB-84C6-200881DF2B2B}")
 
 EntitySpawnTicket (const EntitySpawnTicket &rhs)
 
 EntitySpawnTicket (EntitySpawnTicket &&rhs)
 
 EntitySpawnTicket (AZ::Data::Asset< Spawnable > spawnable)
 
EntitySpawnTicketoperator= (const EntitySpawnTicket &rhs)
 
EntitySpawnTicketoperator= (EntitySpawnTicket &&rhs)
 
bool operator== (const EntitySpawnTicket &rhs) const
 
bool operator!= (const EntitySpawnTicket &rhs) const
 
Id GetId () const
 Returns an id that uniquely identifies this ticket or 0 if no spawnable has been assigned.
 
const AZ::Data::Asset< Spawnable > * GetSpawnable () const
 Returns the assets associated with the ticket or a nullptr if no spawnable has been assigned yet.
 
bool IsValid () const
 Returns whether or not the ticket is in a usable state.
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Friends

class SpawnableEntitiesDefinition
 

Detailed Description

Requests to the SpawnableEntitiesInterface require a ticket with a valid spawnable that is used as a template. A ticket can be reused for multiple calls on the same spawnable and is safe to be used by multiple threads at the same time. Entities created from the spawnable may be tracked by the ticket and so using the same ticket is needed to despawn the exact entities created by a call to spawn entities. The life cycle of the spawned entities is tied to the ticket and all entities spawned using a ticket will be despawned when it's deleted.


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