aztecs-0.12.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 HaskellSafe-Inferred
LanguageHaskell2010

Aztecs.ECS.World

Description

 
Synopsis

Documentation

data World Source #

World of entities and their components.

Since: 0.9

Constructors

World 

Fields

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.12.0-GlKmPfHNl6i8JdqwU1RE4N" 'False) (C1 ('MetaCons "World" 'PrefixI 'True) (S1 ('MetaSel ('Just "entities") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Entities) :*: S1 ('MetaSel ('Just "nextEntityId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EntityID)))

empty :: World Source #

Empty World.

Since: 0.9

spawn :: Bundle -> World -> (EntityID, World) Source #

Spawn a Bundle into the World.

Since: 0.9

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

Spawn an empty entity.

Since: 0.9

insert :: EntityID -> Bundle -> World -> World Source #

Insert a Bundle into an entity.

Since: 0.9

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

Lookup a component in an entity.

Since: 0.9

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

Remove a component from an entity.

Since: 0.9

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

Remove a component from an entity with its ComponentID.

Since: 0.9

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

Despawn an entity, returning its components.