| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Mischief.ECS.Systems
Description
Module with utility functions for creating and scheduling systems.
Synopsis
- data SystemConfig = SystemConfig {}
- newtype Systems = Systems [System ()]
- type ToSystems a = Collectable a Systems
- systems :: ToSystems a => a -> SystemConfig
- after :: ToSystems a => a -> SystemConfig -> SystemConfig
- before :: ToSystems a => a -> SystemConfig -> SystemConfig
- schedule :: forall {k} (sc :: k). Schedule sc => SystemConfig -> System ()
- order :: forall {k} (sc :: k) a b. (Schedule sc, ToSystems a, ToSystems b) => (a, b) -> System ()
- spawn :: System () -> System Entity
- get :: forall {k} (sc :: k). Schedule sc => System () -> System Entity
- unschedule :: forall {k} (sc :: k) a. (Schedule sc, ToSystems a) => a -> System ()
- unschedule' :: forall {k} (sc :: k) a. (Schedule sc, ToSystems a) => a -> System ()
Documentation
data SystemConfig Source #
type ToSystems a = Collectable a Systems Source #
systems :: ToSystems a => a -> SystemConfig Source #
after :: ToSystems a => a -> SystemConfig -> SystemConfig Source #
before :: ToSystems a => a -> SystemConfig -> SystemConfig Source #
order :: forall {k} (sc :: k) a b. (Schedule sc, ToSystems a, ToSystems b) => (a, b) -> System () Source #
unschedule :: forall {k} (sc :: k) a. (Schedule sc, ToSystems a) => a -> System () Source #
Disconnect a system from a schedule. This will keep the system's entity alive, as well as all its other relationships and data,
so that if scheduled again it will work the same as before. Use this if you plan to dynamically schedule and unschedule a system. Otherwise check unschedule'.
unschedule' :: forall {k} (sc :: k) a. (Schedule sc, ToSystems a) => a -> System () Source #
Disconnect a system rom a schedule. This will despawn the system's entity, losing all its data such as ordering with other systems.
Use this if you want to disable a scheduled system for good. Otherwise check unschedule.