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.View

Description

 
Synopsis

Documentation

newtype View (m :: Type -> Type) Source #

View into a World, containing a subset of archetypes.

Constructors

View 

Fields

Instances

Instances details
Monoid (View m) Source # 
Instance details

Defined in Aztecs.ECS.View

Methods

mempty :: View m #

mappend :: View m -> View m -> View m #

mconcat :: [View m] -> View m #

Semigroup (View m) Source # 
Instance details

Defined in Aztecs.ECS.View

Methods

(<>) :: View m -> View m -> View m #

sconcat :: NonEmpty (View m) -> View m #

stimes :: Integral b => b -> View m -> View m #

Show (View m) Source # 
Instance details

Defined in Aztecs.ECS.View

Methods

showsPrec :: Int -> View m -> ShowS #

show :: View m -> String #

showList :: [View m] -> ShowS #

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.

null :: forall (m :: Type -> Type). View m -> Bool Source #

True if the View is empty.

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.