Jazz2::Events::EventSpawner class

Spawns objects in a level.

Public types

using CreateDelegate = std::shared_ptr<Actors::ActorBase>(*)(const Actors::ActorActivationDetails&details)
Delegate to create an object.
using PreloadDelegate = void(*)(const Actors::ActorActivationDetails&details)
Delegate to preload assets for an object.

Public static variables

static std::int32_t SpawnParamsSize constexpr

Constructors, destructors, conversion operators

EventSpawner(ILevelHandler* levelHandler)

Public functions

void PreloadEvent(EventType type, std::uint8_t* spawnParams)
Preloads assets for a given event.
auto SpawnEvent(EventType type, std::uint8_t* spawnParams, Actors::ActorState flags, std::int32_t x, std::int32_t y, std::int32_t z) -> std::shared_ptr<Actors::ActorBase>
Spawns an object for a given event.
auto SpawnEvent(EventType type, std::uint8_t* spawnParams, Actors::ActorState flags, const Vector3i& pos) -> std::shared_ptr<Actors::ActorBase>
void RegisterSpawnable(EventType type, CreateDelegate create, PreloadDelegate preload = nullptr)
Registers a delegate to create an object from an event.

Function documentation

std::shared_ptr<Actors::ActorBase> Jazz2::Events::EventSpawner::SpawnEvent(EventType type, std::uint8_t* spawnParams, Actors::ActorState flags, const Vector3i& pos)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.