apecs-0.2.2.0: A fast ECS for game engine programming

Safe HaskellNone
LanguageHaskell2010

Apecs.Slice

Description

This module is designed to be imported with qualified

Synopsis

Documentation

foldM_ :: (a -> Entity c -> System w a) -> a -> Slice b -> System w () Source #

Slice version of foldM_

size :: Slice a -> Int Source #

Gets the size of a slice (O(n))

null :: Slice a -> Bool Source #

Tests whether a slice is empty (O(1))

fromList :: [Int] -> Slice a Source #

Construct a slice from a list of IDs

filterM :: (Entity c -> System w Bool) -> Slice c -> System w (Slice c) Source #

Monadically filter a slice

concat :: Slice a -> Slice b -> Slice c Source #

Concatenates two slices. Equivalent to mappend

forM_ :: Monad m => Slice c -> (Entity c -> m b) -> m () Source #

Slice version of forM_

forM :: Monad m => Slice c -> (Entity c -> m a) -> m [a] Source #

Slice version of forM

forMC :: forall w c a. Has w c => Slice c -> ((Entity c, Safe c) -> System w a) -> System w [a] Source #

Iterates over a slice, and reads the components of the Slice's type argument.

forMC_ :: forall w c a. Has w c => Slice c -> ((Entity c, Safe c) -> System w a) -> System w () Source #

Iterates over a slice, and reads the components of the Slice's type argument.

mapM_ :: Monad m => (Entity c -> m a) -> Slice c -> m () Source #

Slice version of mapM_

mapM :: Monad m => (Entity c -> m a) -> Slice c -> m [a] Source #

Slice version of mapM

mapMC :: forall w c a. Has w c => ((Entity c, Safe c) -> System w a) -> Slice c -> System w [a] Source #

Iterates over a slice, and reads the components of the Slice's type argument.

mapMC_ :: forall w c a. Has w c => ((Entity c, Safe c) -> System w a) -> Slice c -> System w () Source #

Iterates over a slice, and reads the components of the Slice's type argument.