mischief-ecs
Safe HaskellNone
LanguageGHC2024

Mischief.ECS.World.Query

Documentation

findArchetypes :: forall qd m w output. (Queryable qd output, MonadSystem w m) => qd -> m [([ComponentId], ArchetypeId)] Source #

entityQuery :: forall qd output m w. (Queryable qd output, MonadSystem w m) => qd -> Entity -> m (Maybe output) Source #

class GetComponentId c where Source #

Methods

getComponentId' :: forall w (m :: Type -> Type). MonadSystem w m => c -> FilterComponent Source #

tryMetaLocal :: forall c m w. (Component c, MonadSystem w m) => m (Maybe Entity) Source #

addedChanged :: forall m w. MonadSystem w m => (ComponentTicks -> Tick -> Tick -> Bool) -> FilterComponent -> Entity -> m Bool Source #

added :: forall c m w. (MonadSystem w m, ToFilterComponent c) => c -> Entity -> m Bool Source #

changed :: forall c m w. (MonadSystem w m, ToFilterComponent c) => c -> Entity -> m Bool Source #

has :: forall c m w. (MonadSystem w m, ToFilterComponent c) => c -> Entity -> m Bool Source #

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

Constructors

BuildQuery :: forall qd a (m :: Type -> Type). Queryable qd a => qd -> QueryFilter 'ArchetypeFilter -> Maybe [Entity] -> Query m a 
MapQuery :: forall (m :: Type -> Type) b a. Query m b -> (Entity -> b -> m a) -> Query m a 
FilterQuery :: forall (m :: Type -> Type) a. Query m a -> (Entity -> a -> m Bool) -> Query m a 
PairEntityQuery :: forall (m :: Type -> Type) a1. Query m a1 -> Query m (Entity, a1) 
DoQuery :: forall (m :: Type -> Type) a b. Query m a -> (Entity -> a -> m b) -> Query m a 
FoldQuery :: forall (m :: Type -> Type) a1 a. Query m a1 -> Entity -> (From a1 -> a -> a) -> a -> Query m a 
PureQuery :: forall a (m :: Type -> Type). a -> Query m a 
AppQuery :: forall (m :: Type -> Type) a1 a. Query m (a1 -> a) -> Query m a1 -> Query m a 
BindQuery :: forall (m :: Type -> Type) a1 a. Query m a1 -> (a1 -> Query m a) -> Query m a 
EmptyQuery :: forall (m :: Type -> Type) a. Query m a 
RefocusQuery :: forall (m :: Type -> Type) a. Query m a -> Entity -> Query m a 

Instances

Instances details
MonadSystem w m => Applicative (Query m) Source # 
Instance details

Defined in Mischief.ECS.World.Query

Methods

pure :: a -> Query m a #

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

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

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

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

MonadSystem w m => Functor (Query m) Source # 
Instance details

Defined in Mischief.ECS.World.Query

Methods

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

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

MonadSystem w m => Monad (Query m) Source # 
Instance details

Defined in Mischief.ECS.World.Query

Methods

(>>=) :: Query m a -> (a -> Query m b) -> Query m b #

(>>) :: Query m a -> Query m b -> Query m b #

return :: a -> Query m a #

qrun :: MonadSystem w m => Query m out -> m [(Entity, out)] Source #

tryJoin :: (Entity, a) -> (Entity, a -> b) -> Maybe (Entity, b) Source #

query :: MonadSystem w m => Query m out -> m [out] Source #

query_ :: MonadSystem w m => Query m out -> m () Source #

single :: MonadSystem w m => Query m out -> m (Maybe out) Source #

mkQuery :: forall qd out (m :: Type -> Type). Queryable qd out => qd -> Query m out Source #

mkQuery' :: forall qd out (m :: Type -> Type). Queryable qd out => qd -> QueryFilter 'ArchetypeFilter -> Query m out Source #

mkGet :: forall qd out (m :: Type -> Type). Queryable qd out => Entity -> qd -> Query m out Source #

mkGet' :: forall qd out (m :: Type -> Type). Queryable qd out => Entity -> qd -> QueryFilter 'ArchetypeFilter -> Query m out Source #