| Copyright | (c) Matt Hunzinger 2025 |
|---|---|
| License | BSD-style (see the LICENSE file in the distribution) |
| Maintainer | matt@hunzinger.me |
| Stability | provisional |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
Aztecs.ECS.Query.Dynamic.Class
Description
Synopsis
- class (Monad m, Functor f) => DynamicQueryF (m :: Type -> Type) (f :: Type -> Type) | f -> m where
- entity :: f EntityID
- queryDyn :: Component m a => ComponentID -> f a
- queryMaybeDyn :: Component m a => ComponentID -> f (Maybe a)
- queryMapDyn :: Component m a => (a -> a) -> ComponentID -> f a
- queryMapDyn_ :: Component m a => (a -> a) -> ComponentID -> f ()
- queryMapDynM :: (Monad m, Component m a) => (a -> m a) -> ComponentID -> f a
- queryMapDynWith :: Component m b => (a -> b -> b) -> ComponentID -> f a -> f b
- queryMapDynWith_ :: Component m b => (a -> b -> b) -> ComponentID -> f a -> f ()
- queryMapDynWithM :: (Monad m, Component m b) => (a -> b -> m b) -> ComponentID -> f a -> f b
- queryMapDynWithAccum :: Component m c => (b -> c -> (a, c)) -> ComponentID -> f b -> f (a, c)
- queryMapDynWithAccumM :: (Monad m, Component m c) => (b -> c -> m (a, c)) -> ComponentID -> f b -> f (a, c)
- queryFilterMap :: (a -> Maybe b) -> f a -> f b
- queryFilter :: (a -> Bool) -> f a -> f a
- queryUntracked :: f a -> f a
Documentation
class (Monad m, Functor f) => DynamicQueryF (m :: Type -> Type) (f :: Type -> Type) | f -> m where Source #
Dynamic query functor.
Minimal complete definition
entity, queryDyn, queryMapDyn, queryMapDynM, queryMapDynWith, queryMapDynWithM, queryMapDynWithAccum, queryMapDynWithAccumM, queryFilterMap, queryUntracked
Methods
Fetch the currently matched EntityID.
queryDyn :: Component m a => ComponentID -> f a Source #
Fetch a Component by its ComponentID.
queryMaybeDyn :: Component m a => ComponentID -> f (Maybe a) Source #
Try to query a Component by its ComponentID.
queryMapDyn :: Component m a => (a -> a) -> ComponentID -> f a Source #
Map over a Component by its ComponentID.
queryMapDyn_ :: Component m a => (a -> a) -> ComponentID -> f () Source #
Map over a Component by its ComponentID, ignoring any output.
queryMapDynM :: (Monad m, Component m a) => (a -> m a) -> ComponentID -> f a Source #
Map over a Component by its ComponentID with a monadic function.
queryMapDynWith :: Component m b => (a -> b -> b) -> ComponentID -> f a -> f b Source #
Map over a Component by its ComponentID with input.
queryMapDynWith_ :: Component m b => (a -> b -> b) -> ComponentID -> f a -> f () Source #
Map over a Component by its ComponentID with input, ignoring any output.
queryMapDynWithM :: (Monad m, Component m b) => (a -> b -> m b) -> ComponentID -> f a -> f b Source #
Map over a Component by its ComponentID with input and a monadic function.
queryMapDynWithAccum :: Component m c => (b -> c -> (a, c)) -> ComponentID -> f b -> f (a, c) Source #
Map over a Component by its ComponentID with input, returning a tuple of the result and the updated component.
queryMapDynWithAccumM :: (Monad m, Component m c) => (b -> c -> m (a, c)) -> ComponentID -> f b -> f (a, c) Source #
Map over a Component by its ComponentID with input and a monadic function, returning a tuple.
queryFilterMap :: (a -> Maybe b) -> f a -> f b Source #
Filter a query and map the results, constraining the query to entities that satisfy the predicate.
queryFilter :: (a -> Bool) -> f a -> f a Source #
Filter a query, constraining it to entities that satisfy the predicate.
queryUntracked :: f a -> f a Source #
Run a query without tracking changes.