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 | Safe-Inferred |
Language | Haskell2010 |
Aztecs.ECS.World
Description
Synopsis
- data World = World {
- entities :: !Entities
- nextEntityId :: !EntityID
- empty :: World
- spawn :: Bundle -> World -> (EntityID, World)
- spawnEmpty :: World -> (EntityID, World)
- insert :: EntityID -> Bundle -> World -> World
- lookup :: forall a. Component a => EntityID -> World -> Maybe a
- remove :: forall a. Component a => EntityID -> World -> (Maybe a, World)
- removeWithId :: forall a. Component a => EntityID -> ComponentID -> World -> (Maybe a, World)
- despawn :: EntityID -> World -> (IntMap Dynamic, World)
Documentation
World of entities and their components.
Since: 0.9
Constructors
World | |
Fields
|
Instances
Generic World Source # | |
Show World Source # | |
NFData World Source # | |
Defined in Aztecs.ECS.World | |
type Rep World Source # | |
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))) |
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