| 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.Component
Description
Synopsis
- newtype ComponentID = ComponentID {
- unComponentId :: Int
- class (Monad m, Typeable a, Storage a (StorageT a)) => Component (m :: Type -> Type) a where
- type StorageT a
- componentOnInsert :: EntityID -> a -> Access m ()
- componentOnChange :: EntityID -> a -> Access m ()
- componentOnRemove :: EntityID -> a -> Access m ()
Documentation
newtype ComponentID Source #
Unique component identifier.
Constructors
| ComponentID | |
Fields
| |
Instances
class (Monad m, Typeable a, Storage a (StorageT a)) => Component (m :: Type -> Type) a where Source #
Component that can be stored in the World.
Minimal complete definition
Nothing
Methods
componentOnInsert :: EntityID -> a -> Access m () Source #
Lifecycle hook called when a component is inserted.
componentOnChange :: EntityID -> a -> Access m () Source #
Lifecycle hook called when a component is changed.
componentOnRemove :: EntityID -> a -> Access m () Source #
Lifecycle hook called when a component is removed.
Instances
| Monad m => Component m ChildState Source # | |||||
Defined in Aztecs.Hierarchy Associated Types
Methods componentOnInsert :: EntityID -> ChildState -> Access m () Source # componentOnChange :: EntityID -> ChildState -> Access m () Source # componentOnRemove :: EntityID -> ChildState -> Access m () Source # | |||||
| Monad m => Component m Children Source # | |||||
Defined in Aztecs.Hierarchy Associated Types
| |||||
| Monad m => Component m Parent Source # | |||||
Defined in Aztecs.Hierarchy Associated Types
| |||||
| Monad m => Component m ParentState Source # | |||||
Defined in Aztecs.Hierarchy Associated Types
Methods componentOnInsert :: EntityID -> ParentState -> Access m () Source # componentOnChange :: EntityID -> ParentState -> Access m () Source # componentOnRemove :: EntityID -> ParentState -> Access m () Source # | |||||
| (Monad m, Typeable m, Event e) => Component m (Observer m e) Source # | |||||
Defined in Aztecs.ECS.Observer Associated Types
| |||||