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

Description

 
Synopsis

Documentation

newtype ArchetypeID Source #

Archetype ID.

Since: 0.9

Constructors

ArchetypeID 

Fields

data Node Source #

Node in Archetypes.

Since: 0.9

Constructors

Node 

Fields

Instances

Instances details
Generic Node Source # 
Instance details

Defined in Aztecs.ECS.World.Archetypes

Associated Types

type Rep Node :: Type -> Type #

Methods

from :: Node -> Rep Node x #

to :: Rep Node x -> Node #

Show Node Source # 
Instance details

Defined in Aztecs.ECS.World.Archetypes

Methods

showsPrec :: Int -> Node -> ShowS #

show :: Node -> String #

showList :: [Node] -> ShowS #

NFData Node Source # 
Instance details

Defined in Aztecs.ECS.World.Archetypes

Methods

rnf :: Node -> () #

type Rep Node Source # 
Instance details

Defined in Aztecs.ECS.World.Archetypes

type Rep Node = D1 ('MetaData "Node" "Aztecs.ECS.World.Archetypes" "aztecs-0.12.0-GlKmPfHNl6i8JdqwU1RE4N" 'False) (C1 ('MetaCons "Node" 'PrefixI 'True) (S1 ('MetaSel ('Just "nodeComponentIds") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set ComponentID)) :*: S1 ('MetaSel ('Just "nodeArchetype") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Archetype)))

data Archetypes Source #

Constructors

Archetypes 

Fields

Instances

Instances details
Generic Archetypes Source # 
Instance details

Defined in Aztecs.ECS.World.Archetypes

Associated Types

type Rep Archetypes :: Type -> Type #

Show Archetypes Source # 
Instance details

Defined in Aztecs.ECS.World.Archetypes

NFData Archetypes Source # 
Instance details

Defined in Aztecs.ECS.World.Archetypes

Methods

rnf :: Archetypes -> () #

type Rep Archetypes Source # 
Instance details

Defined in Aztecs.ECS.World.Archetypes

type Rep Archetypes = D1 ('MetaData "Archetypes" "Aztecs.ECS.World.Archetypes" "aztecs-0.12.0-GlKmPfHNl6i8JdqwU1RE4N" 'False) (C1 ('MetaCons "Archetypes" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nodes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map ArchetypeID Node)) :*: S1 ('MetaSel ('Just "archetypeIds") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Set ComponentID) ArchetypeID))) :*: (S1 ('MetaSel ('Just "nextArchetypeId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ArchetypeID) :*: S1 ('MetaSel ('Just "componentIds") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map ComponentID (Set ArchetypeID))))))

empty :: Archetypes Source #

Empty Archetypes.

Since: 0.9

insertArchetype :: Set ComponentID -> Node -> Archetypes -> (ArchetypeID, Archetypes) Source #

Insert an archetype by its set of ComponentIDs.

Since: 0.9

lookup :: ArchetypeID -> Archetypes -> Maybe Node Source #

Lookup an Archetype by its ArchetypeID.

Since: 0.9

find :: Set ComponentID -> Set ComponentID -> Archetypes -> Map ArchetypeID Node Source #

Lookup Archetypes containing a set of ComponentIDs.

Since: 0.9

insert :: EntityID -> ArchetypeID -> Set ComponentID -> DynamicBundle -> Archetypes -> (Maybe ArchetypeID, Archetypes) Source #

Insert a component into an entity with its ComponentID.

Since: 0.9

remove :: Component a => EntityID -> ArchetypeID -> ComponentID -> Archetypes -> (Maybe (a, ArchetypeID), Archetypes) Source #

Remove a component from an entity with its ComponentID.

Since: 0.9