mischief-ecs
Safe HaskellNone
LanguageGHC2024

Mischief.ECS.World.Spawn

Synopsis

Documentation

spawn :: (HasCallStack, Bundle b) => b -> System Entity Source #

Spawn an entity given a bundle of components.

spawn_ :: (HasCallStack, Bundle b) => b -> System () Source #

Same as spawn but discards the returned entity.

spawnDefer :: Bundle b => b -> ParSystem Entity Source #

Spawn an entity given a bundle of components, inside a ParSystem.

This will immediately reserve and return an Entity index which can be used, while defering the actual spawn.

spawnEntity :: (HasCallStack, Bundle b) => Entity -> b -> System () Source #

Spawn an Entity given an existing, reserved id. This is not meant for general use.

spawnIO :: Bundle b => World -> b -> IO Entity Source #

Spawn an entity given a bundle of components, in IO.

despawn :: Entity -> System () Source #

Despawn an entity. This will trigger the OnRemove events and hooks on all its components.