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.Entities

Description

 
Synopsis

Documentation

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

World of entities and their components.

Constructors

Entities 

Fields

Instances

Instances details
Generic (Entities m) Source # 
Instance details

Defined in Aztecs.ECS.World.Entities.Internal

Associated Types

type Rep (Entities m) 
Instance details

Defined in Aztecs.ECS.World.Entities.Internal

type Rep (Entities m) = D1 ('MetaData "Entities" "Aztecs.ECS.World.Entities.Internal" "aztecs-0.16.0-1t3LRuVnzUqKpg58E4sSVq" 'False) (C1 ('MetaCons "Entities" 'PrefixI 'True) (S1 ('MetaSel ('Just "archetypes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Archetypes m)) :*: (S1 ('MetaSel ('Just "components") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Components) :*: S1 ('MetaSel ('Just "entities") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map EntityID ArchetypeID)))))

Methods

from :: Entities m -> Rep (Entities m) x #

to :: Rep (Entities m) x -> Entities m #

Show (Entities m) Source # 
Instance details

Defined in Aztecs.ECS.World.Entities.Internal

Methods

showsPrec :: Int -> Entities m -> ShowS #

show :: Entities m -> String #

showList :: [Entities m] -> ShowS #

type Rep (Entities m) Source # 
Instance details

Defined in Aztecs.ECS.World.Entities.Internal

type Rep (Entities m) = D1 ('MetaData "Entities" "Aztecs.ECS.World.Entities.Internal" "aztecs-0.16.0-1t3LRuVnzUqKpg58E4sSVq" 'False) (C1 ('MetaCons "Entities" 'PrefixI 'True) (S1 ('MetaSel ('Just "archetypes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Archetypes m)) :*: (S1 ('MetaSel ('Just "components") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Components) :*: S1 ('MetaSel ('Just "entities") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map EntityID ArchetypeID)))))

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

Empty World.

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

Spawn a Bundle. Returns the updated entities and the onInsert hook to run.

spawnWithArchetypeId :: forall (m :: Type -> Type). Monad m => EntityID -> ArchetypeID -> DynamicBundle m -> Entities m -> (Entities m, Access m ()) Source #

Spawn a DynamicBundle with a specified ArchetypeID. Returns the updated entities and the onInsert hook.

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

Insert a component into an entity. Returns the updated entities and the onInsert hook.

insertDyn :: forall (m :: Type -> Type). Monad m => EntityID -> Set ComponentID -> DynamicBundle m -> Entities m -> (Entities m, Access m ()) Source #

Insert a component into an entity with its ComponentID. Returns the updated entities and the onInsert hook.

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

Insert a component into an entity without running lifecycle hooks.

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

Lookup a component in an entity.

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

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

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

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

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

Despawn an entity, returning its components.