aztecs-0.16.0: A modular game engine and Entity-Component-System (ECS) for Haskell.
Copyright(c) Matt Hunzinger 2025
LicenseBSD-style (see the LICENSE file in the distribution)
Maintainermatt@hunzinger.me
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Aztecs.ECS.System.Dynamic

Description

 
Synopsis

Dynamic systems

data DynamicSystem (m :: Type -> Type) a where Source #

Dynamic system.

Constructors

Pure :: forall a (m :: Type -> Type). a -> DynamicSystem m a

Pure value.

Map :: forall b a (m :: Type -> Type). (b -> a) -> DynamicSystem m b -> DynamicSystem m a

Functor map.

Ap :: forall (m :: Type -> Type) b a. DynamicSystem m (b -> a) -> DynamicSystem m b -> DynamicSystem m a

Applicative apply.

Op :: forall (m :: Type -> Type) a. Set ComponentID -> Op m a -> DynamicSystem m a

Query operation.

Instances

Instances details
Applicative (DynamicSystem m) Source # 
Instance details

Defined in Aztecs.ECS.System.Dynamic

Methods

pure :: a -> DynamicSystem m a #

(<*>) :: DynamicSystem m (a -> b) -> DynamicSystem m a -> DynamicSystem m b #

liftA2 :: (a -> b -> c) -> DynamicSystem m a -> DynamicSystem m b -> DynamicSystem m c #

(*>) :: DynamicSystem m a -> DynamicSystem m b -> DynamicSystem m b #

(<*) :: DynamicSystem m a -> DynamicSystem m b -> DynamicSystem m a #

Functor (DynamicSystem m) Source # 
Instance details

Defined in Aztecs.ECS.System.Dynamic

Methods

fmap :: (a -> b) -> DynamicSystem m a -> DynamicSystem m b #

(<$) :: a -> DynamicSystem m b -> DynamicSystem m a #

runDynamicSystem :: Monad m => DynamicSystem m a -> Entities m -> m (a, Entities m, Access m ()) Source #

Run a dynamic system on entities, returning results, updated entities, and hooks to run.

Queries

runQuery :: forall (m :: Type -> Type) a. Set ComponentID -> DynamicQuery m a -> DynamicSystem m (Vector a) Source #

runQueryFiltered :: forall (m :: Type -> Type) a. Set ComponentID -> DynamicQuery m a -> (Node m -> Bool) -> DynamicSystem m (Vector a) Source #

readQuery :: forall (m :: Type -> Type) a. Set ComponentID -> DynamicQuery m a -> DynamicSystem m (Vector a) Source #

readQueryFiltered :: forall (m :: Type -> Type) a. Set ComponentID -> (Node m -> Bool) -> DynamicQuery m a -> DynamicSystem m (Vector a) Source #