aztecs-0.10.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 HaskellSafe-Inferred
LanguageHaskell2010

Aztecs.ECS.Query.Reader

Description

 
Synopsis

Queries

newtype QueryReader a Source #

Query to read from entities.

Since: 0.10

Constructors

QueryReader 

Fields

Instances

Instances details
DynamicQueryReaderF QueryReader Source #

Since: 0.10

Instance details

Defined in Aztecs.ECS.Query.Reader

QueryReaderF QueryReader Source #

Since: 0.10

Instance details

Defined in Aztecs.ECS.Query.Reader

Applicative QueryReader Source #

Since: 0.10

Instance details

Defined in Aztecs.ECS.Query.Reader

Methods

pure :: a -> QueryReader a #

(<*>) :: QueryReader (a -> b) -> QueryReader a -> QueryReader b #

liftA2 :: (a -> b -> c) -> QueryReader a -> QueryReader b -> QueryReader c #

(*>) :: QueryReader a -> QueryReader b -> QueryReader b #

(<*) :: QueryReader a -> QueryReader b -> QueryReader a #

Functor QueryReader Source # 
Instance details

Defined in Aztecs.ECS.Query.Reader

Methods

fmap :: (a -> b) -> QueryReader a -> QueryReader b #

(<$) :: a -> QueryReader b -> QueryReader a #

MonadReaderSystem QueryReader System Source #

Since: 0.9

Instance details

Defined in Aztecs.ECS.System

Monad m => MonadReaderSystem QueryReader (AccessT m) Source #

Since: 0.9

Instance details

Defined in Aztecs.ECS.Access

class Functor f => QueryReaderF f where Source #

Query reader functor.

Since: 0.10

Minimal complete definition

fetch

Methods

fetch :: Component a => f a Source #

Fetch a Component by its type.

Since: 0.10

fetchMaybe :: Component a => f (Maybe a) Source #

Fetch a Component by its type, returning Nothing if it doesn't exist.

Since: 0.10

Instances

Instances details
QueryReaderF QueryReader Source #

Since: 0.10

Instance details

Defined in Aztecs.ECS.Query.Reader

Applicative f => QueryReaderF (QueryT f) Source #

Since: 0.10

Instance details

Defined in Aztecs.ECS.Query

class Functor f => DynamicQueryReaderF f where Source #

Dynamic query reader functor.

Since: 0.10

Minimal complete definition

entity, fetchDyn

Methods

entity :: f EntityID Source #

Fetch the currently matched EntityID.

Since: 0.10

fetchDyn :: Component a => ComponentID -> f a Source #

Fetch a Component by its ComponentID.

Since: 0.10

fetchMaybeDyn :: Component a => ComponentID -> f (Maybe a) Source #

Try to fetch a Component by its ComponentID.

Since: 0.10

Running

all :: QueryReader a -> Entities -> ([a], Entities) Source #

Match all entities.

Since: 0.10

all' :: QueryReader a -> Entities -> ([a], Components) Source #

Match all entities.

Since: 0.10

single :: HasCallStack => QueryReader a -> Entities -> (a, Entities) Source #

Match a single entity.

Since: 0.10

single' :: HasCallStack => QueryReader a -> Entities -> (a, Components) Source #

Match a single entity.

Since: 0.10

singleMaybe :: QueryReader a -> Entities -> (Maybe a, Entities) Source #

Match a single entity.

Since: 0.10

singleMaybe' :: QueryReader a -> Entities -> (Maybe a, Components) Source #

Match a single entity.

Since: 0.10

Filters

newtype QueryFilter Source #

Filter for a Query.

Since: 0.9

Constructors

QueryFilter 

Fields

with :: forall a. Component a => QueryFilter Source #

Filter for entities containing this component.

Since: 0.9

without :: forall a. Component a => QueryFilter Source #

Filter out entities containing this component.

Since: 0.9