aztecs-0.8.0: A modular game engine and Entity-Component-System (ECS) for Haskell.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Aztecs.ECS.World

Synopsis

Documentation

data World Source #

World of entities and their components.

Constructors

World 

Instances

Instances details
Generic World Source # 
Instance details

Defined in Aztecs.ECS.World

Associated Types

type Rep World :: Type -> Type #

Methods

from :: World -> Rep World x #

to :: Rep World x -> World #

Show World Source # 
Instance details

Defined in Aztecs.ECS.World

Methods

showsPrec :: Int -> World -> ShowS #

show :: World -> String #

showList :: [World] -> ShowS #

NFData World Source # 
Instance details

Defined in Aztecs.ECS.World

Methods

rnf :: World -> () #

type Rep World Source # 
Instance details

Defined in Aztecs.ECS.World

type Rep World = D1 ('MetaData "World" "Aztecs.ECS.World" "aztecs-0.8.0-5YWGoxTs0Vw9iciqZAe9GO" 'False) (C1 ('MetaCons "World" 'PrefixI 'True) (S1 ('MetaSel ('Just "entities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Entities) :*: S1 ('MetaSel ('Just "nextEntityId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EntityID)))

spawnWithArchetypeId :: forall a. Component a => ArchetypeID -> ComponentID -> a -> World -> (EntityID, World) Source #

Spawn an entity with a component and its ComponentID directly into an archetype.

spawnEmpty :: World -> (EntityID, World) Source #

Spawn an empty entity.

insert :: forall a. Component a => EntityID -> a -> World -> World Source #

Insert a component into an entity.

insertWithId :: Component a => EntityID -> ComponentID -> a -> World -> World Source #

Insert a component into an entity with its ComponentID.

lookup :: forall a. Component a => EntityID -> World -> Maybe a Source #

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

Insert a component into an entity.

despawn :: EntityID -> World -> (Map ComponentID Dynamic, World) Source #

Despawn an entity, returning its components.