mischief-ecs
Safe HaskellNone
LanguageGHC2024

Mischief.ECS.Resources

Synopsis

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.

modifyRes :: (Component r, Bundle r) => (Maybe r -> r) -> System () Source #

Modify the value of a resource if it exists, otherwise insert the result of the function.

modifyRes' :: (Component r, Bundle r) => (r -> r) -> System () Source #

Modify the value of a resource if it exists, otherwise do nothing.