aztecs-0.16.0: A modular game engine and Entity-Component-System (ECS) for Haskell.
Copyright(c) Matt Hunzinger 2025
LicenseBSD-style (see the LICENSE file in the distribution)
Maintainermatt@hunzinger.me
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Aztecs.ECS.World

Description

 
Synopsis

Documentation

data World (m :: Type -> Type) Source #

World of entities and their components.

Constructors

World 

Fields

empty :: forall (m :: Type -> Type). World m Source #

Empty World.

spawn :: forall (m :: Type -> Type). Monad m => BundleT m -> World m -> (EntityID, World m, Access m ()) Source #

Spawn a Bundle into the World. Returns the entity ID, updated world, and onInsert hook.

spawnEmpty :: forall (m :: Type -> Type). World m -> (EntityID, World m) Source #

Spawn an empty entity.

insert :: forall (m :: Type -> Type). Monad m => EntityID -> BundleT m -> World m -> (World m, Access m ()) Source #

Insert a Bundle into an entity. Returns updated world and onInsert hook.

insertUntracked :: forall (m :: Type -> Type). Monad m => EntityID -> BundleT m -> World m -> World m Source #

Insert a Bundle into an entity without running lifecycle hooks.

lookup :: forall (m :: Type -> Type) a. Component m a => EntityID -> World m -> Maybe a Source #

Lookup a component in an entity.

remove :: forall (m :: Type -> Type) a. Component m a => EntityID -> World m -> (Maybe a, World m, Access m ()) Source #

Remove a component from an entity. Returns the component (if found), updated world, and onRemove hook.

removeWithId :: forall (m :: Type -> Type) a. Component m a => EntityID -> ComponentID -> World m -> (Maybe a, World m, Access m ()) Source #

Remove a component from an entity with its ComponentID. Returns the component (if found), updated world, and onRemove hook.

despawn :: forall (m :: Type -> Type). EntityID -> World m -> (IntMap Dynamic, World m) Source #

Despawn an entity, returning its components.