| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Mischief.ECS.Resources
Synopsis
- insertRes :: (Component r, Bundle r) => r -> System ()
- res :: forall c m w. (MonadSystem w m, Component c) => m (Maybe c)
- resOrInsert :: (Component r, Bundle r) => r -> System r
- resOrInsertM :: (Component r, Bundle r) => System r -> System r
- modifyRes :: (Component r, Bundle r) => (Maybe r -> r) -> System ()
- modifyRes' :: (Component r, Bundle r) => (r -> r) -> System ()
Documentation
insertRes :: (Component r, Bundle r) => r -> System () Source #
Insert a resource into the World. If the resource already exists, its value will be overwritten.
res :: forall c m w. (MonadSystem w m, Component c) => m (Maybe c) Source #
Get the value of a resource from the World.
resOrInsert :: (Component r, Bundle r) => r -> System r Source #
Get the value of a resource, or insert a resource if it doesn't exist.
resOrInsertM :: (Component r, Bundle r) => System r -> System r Source #
Same as resOrInsert but allows the default resource to be produced by a System.