mischief-ecs
Safe HaskellNone
LanguageGHC2024

Mischief.ECS.Systems

Description

Module with utility functions for creating and scheduling systems.

Synopsis

Documentation

data SystemConfig Source #

Constructors

SystemConfig 

Fields

newtype Systems Source #

Constructors

Systems [System ()] 

Instances

Instances details
Semigroup Systems Source # 
Instance details

Defined in Mischief.ECS.Systems

EraseIntoStorage (System ()) Systems Source # 
Instance details

Defined in Mischief.ECS.Systems

Methods

erase :: System () -> Systems Source #

schedule :: forall {k} (sc :: k). Schedule sc => SystemConfig -> System () Source #

order :: forall {k} (sc :: k) a b. (Schedule sc, ToSystems a, ToSystems b) => (a, b) -> System () Source #

get :: forall {k} (sc :: k). Schedule sc => System () -> System Entity 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.