| 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 | None |
| Language | Haskell2010 |
Aztecs.ECS.World.Components
Description
Synopsis
- newtype ComponentID = ComponentID {
- unComponentId :: Int
- data Components = Components {}
- empty :: Components
- lookup :: Typeable a => Components -> Maybe ComponentID
- insert :: forall a (m :: Type -> Type). Component m a => Components -> (ComponentID, Components)
- insert' :: forall c (m :: Type -> Type). Component m c => Components -> (ComponentID, Components)
Documentation
newtype ComponentID Source #
Unique component identifier.
Constructors
| ComponentID | |
Fields
| |
Instances
data Components Source #
Component ID map.
Constructors
| Components | |
Fields
| |
Instances
| Generic Components Source # | |||||
Defined in Aztecs.ECS.World.Components.Internal Associated Types
| |||||
| Show Components Source # | |||||
Defined in Aztecs.ECS.World.Components.Internal Methods showsPrec :: Int -> Components -> ShowS # show :: Components -> String # showList :: [Components] -> ShowS # | |||||
| type Rep Components Source # | |||||
Defined in Aztecs.ECS.World.Components.Internal type Rep Components = D1 ('MetaData "Components" "Aztecs.ECS.World.Components.Internal" "aztecs-0.16.0-1t3LRuVnzUqKpg58E4sSVq" '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.
lookup :: Typeable a => Components -> Maybe ComponentID Source #
Lookup a component ID by type.
insert :: forall a (m :: Type -> Type). Component m a => Components -> (ComponentID, Components) Source #
Insert a component ID by type, if it does not already exist.
insert' :: forall c (m :: Type -> Type). Component m c => Components -> (ComponentID, Components) Source #
Insert a component ID by type.