aztecs-0.2.0.0: A type-safe and friendly ECS for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Aztecs.World

Synopsis

Documentation

data World Source #

World of entities and their components.

Instances

Instances details
Show World Source # 
Instance details

Defined in Data.Aztecs.World

Methods

showsPrec :: Int -> World -> ShowS #

show :: World -> String #

showList :: [World] -> ShowS #

spawn :: forall a. (Component a, Typeable (StorageT a)) => a -> World -> (EntityID, World) Source #

Spawn an entity with a component.

spawnWithId :: forall a. (Component a, Typeable (StorageT a)) => ComponentID -> a -> World -> (EntityID, World) Source #

Spawn an entity with a component and its ComponentID.

spawnWithArchetypeId :: forall a. (Component a, Typeable (StorageT a)) => a -> ComponentID -> ArchetypeID -> 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, Typeable (StorageT a)) => EntityID -> a -> World -> World Source #

insertArchetype :: Set ComponentID -> Archetype -> World -> (ArchetypeID, World) Source #

Insert an archetype by its set of ComponentIDs.