| 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.View
Description
Synopsis
- newtype View (m :: Type -> Type) = View {
- viewArchetypes :: Map ArchetypeID (Node m)
- view :: forall (m :: Type -> Type). Set ComponentID -> Archetypes m -> View m
- viewSingle :: forall (m :: Type -> Type). Set ComponentID -> Archetypes m -> Maybe (View m)
- filterView :: forall (m :: Type -> Type). Set ComponentID -> (Node m -> Bool) -> Archetypes m -> View m
- null :: forall (m :: Type -> Type). View m -> Bool
- unview :: forall (m :: Type -> Type). View m -> Entities m -> Entities m
- allDyn :: DynamicQuery Identity a -> View Identity -> Vector a
- singleDyn :: DynamicQuery Identity a -> View Identity -> Maybe a
- mapDyn :: Monad m => DynamicQuery m a -> View m -> m (Vector a, View m, Access m ())
- mapSingleDyn :: Monad m => DynamicQuery m a -> View m -> m (Maybe a, View m, Access m ())
Documentation
newtype View (m :: Type -> Type) Source #
View into a World, containing a subset of archetypes.
Constructors
| View | |
Fields
| |
view :: forall (m :: Type -> Type). Set ComponentID -> Archetypes m -> View m Source #
View into all archetypes containing the provided component IDs.
viewSingle :: forall (m :: Type -> Type). Set ComponentID -> Archetypes m -> Maybe (View m) Source #
View into a single archetype containing the provided component IDs.
filterView :: forall (m :: Type -> Type). Set ComponentID -> (Node m -> Bool) -> Archetypes m -> View m Source #
View into all archetypes containing the provided component IDs and matching the provided predicate.
unview :: forall (m :: Type -> Type). View m -> Entities m -> Entities m Source #
"Un-view" a View back into a World.
allDyn :: DynamicQuery Identity a -> View Identity -> Vector a Source #
Query all matching entities in a View.
singleDyn :: DynamicQuery Identity a -> View Identity -> Maybe a Source #
Query all matching entities in a View.
mapDyn :: Monad m => DynamicQuery m a -> View m -> m (Vector a, View m, Access m ()) Source #
Map all matching entities in a View. Returns the results, updated view, and hooks to run.
mapSingleDyn :: Monad m => DynamicQuery m a -> View m -> m (Maybe a, View m, Access m ()) Source #
Map a single matching entity in a View. Returns the result, updated view, and hooks to run.