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.Components
Description
Synopsis
- newtype ComponentID = ComponentID {
- unComponentId :: Int
- data Components = Components {}
- empty :: Components
- lookup :: forall a. Typeable a => Components -> Maybe ComponentID
- insert :: forall a. Component a => Components -> (ComponentID, Components)
- insert' :: forall c. Component c => Components -> (ComponentID, Components)
Documentation
newtype ComponentID Source #
Unique component identifier.
Since: 0.9
Constructors
ComponentID | |
Fields
|
Instances
data Components Source #
Component ID map.
Since: 0.9
Constructors
Components | |
Fields
|
Instances
Generic Components Source # | |
Defined in Aztecs.ECS.World.Components Associated Types type Rep Components :: Type -> Type # | |
Show Components Source # | |
Defined in Aztecs.ECS.World.Components Methods showsPrec :: Int -> Components -> ShowS # show :: Components -> String # showList :: [Components] -> ShowS # | |
NFData Components Source # | |
Defined in Aztecs.ECS.World.Components Methods rnf :: Components -> () # | |
type Rep Components Source # | |
Defined in Aztecs.ECS.World.Components type Rep Components = D1 ('MetaData "Components" "Aztecs.ECS.World.Components" "aztecs-0.12.0-GlKmPfHNl6i8JdqwU1RE4N" 'False) (C1 ('MetaCons "Components" 'PrefixI 'True) (S1 ('MetaSel ('Just "componentIds") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map TypeRep ComponentID)) :*: S1 ('MetaSel ('Just "nextComponentId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ComponentID))) |
empty :: Components Source #
Empty Components
.
Since: 0.9
lookup :: forall a. Typeable a => Components -> Maybe ComponentID Source #
Lookup a component ID by type.
Since: 0.9
insert :: forall a. Component a => Components -> (ComponentID, Components) Source #
Insert a component ID by type, if it does not already exist.
Since: 0.9
insert' :: forall c. Component c => Components -> (ComponentID, Components) Source #
Insert a component ID by type.
Since: 0.9