| Copyright | (c) Matt Hunzinger 2025 |
|---|---|
| License | BSD-style (see the LICENSE file in the distribution) |
| Maintainer | matt@hunzinger.me |
| Stability | provisional |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
Aztecs.ECS.World
Description
Synopsis
- data World (m :: Type -> Type) = World {}
- empty :: forall (m :: Type -> Type). World m
- spawn :: forall (m :: Type -> Type). Monad m => BundleT m -> World m -> (EntityID, World m, Access m ())
- spawnEmpty :: forall (m :: Type -> Type). World m -> (EntityID, World m)
- insert :: forall (m :: Type -> Type). Monad m => EntityID -> BundleT m -> World m -> (World m, Access m ())
- insertUntracked :: forall (m :: Type -> Type). Monad m => EntityID -> BundleT m -> World m -> World m
- lookup :: forall (m :: Type -> Type) a. Component m a => EntityID -> World m -> Maybe a
- remove :: forall (m :: Type -> Type) a. Component m a => EntityID -> World m -> (Maybe a, World m, Access m ())
- removeWithId :: forall (m :: Type -> Type) a. Component m a => EntityID -> ComponentID -> World m -> (Maybe a, World m, Access m ())
- despawn :: forall (m :: Type -> Type). EntityID -> World m -> (IntMap Dynamic, World m)
Documentation
spawn :: forall (m :: Type -> Type). Monad m => BundleT m -> World m -> (EntityID, World m, Access m ()) Source #
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.