apecs-0.6.0.0: Fast ECS framework for game programming

Safe HaskellNone
LanguageHaskell2010

Apecs.Core

Synopsis

Documentation

newtype Entity Source #

An Entity is just an integer, used to index into a component store. In general, use newEntity, cmap, and component tags instead of manipulating these directly.

For performance reasons, negative values like (-1) are reserved for stores to represent special values, so avoid using these.

Constructors

Entity 

Fields

Instances
Enum Entity Source # 
Instance details

Defined in Apecs.Core

Eq Entity Source # 
Instance details

Defined in Apecs.Core

Methods

(==) :: Entity -> Entity -> Bool #

(/=) :: Entity -> Entity -> Bool #

Num Entity Source # 
Instance details

Defined in Apecs.Core

Ord Entity Source # 
Instance details

Defined in Apecs.Core

Show Entity Source # 
Instance details

Defined in Apecs.Core

Component Entity Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage Entity :: * Source #

Monad m => Has w m Entity Source # 
Instance details

Defined in Apecs.Core

type Storage Entity Source # 
Instance details

Defined in Apecs.Core

newtype SystemT w m a Source #

A SystemT is a newtype around `ReaderT w IO a`, where w is the game world variable. Systems mainly serve to

  • Lift side effects into the IO Monad.
  • Allow type-based lookup of a component's store through getStore.

Constructors

SystemT 

Fields

Instances
Monad m => MonadReader w (SystemT w m) Source # 
Instance details

Defined in Apecs.Core

Methods

ask :: SystemT w m w #

local :: (w -> w) -> SystemT w m a -> SystemT w m a #

reader :: (w -> a) -> SystemT w m a #

MonadTrans (SystemT w) Source # 
Instance details

Defined in Apecs.Core

Methods

lift :: Monad m => m a -> SystemT w m a #

Monad m => Monad (SystemT w m) Source # 
Instance details

Defined in Apecs.Core

Methods

(>>=) :: SystemT w m a -> (a -> SystemT w m b) -> SystemT w m b #

(>>) :: SystemT w m a -> SystemT w m b -> SystemT w m b #

return :: a -> SystemT w m a #

fail :: String -> SystemT w m a #

Functor m => Functor (SystemT w m) Source # 
Instance details

Defined in Apecs.Core

Methods

fmap :: (a -> b) -> SystemT w m a -> SystemT w m b #

(<$) :: a -> SystemT w m b -> SystemT w m a #

Applicative m => Applicative (SystemT w m) Source # 
Instance details

Defined in Apecs.Core

Methods

pure :: a -> SystemT w m a #

(<*>) :: SystemT w m (a -> b) -> SystemT w m a -> SystemT w m b #

liftA2 :: (a -> b -> c) -> SystemT w m a -> SystemT w m b -> SystemT w m c #

(*>) :: SystemT w m a -> SystemT w m b -> SystemT w m b #

(<*) :: SystemT w m a -> SystemT w m b -> SystemT w m a #

MonadIO m => MonadIO (SystemT w m) Source # 
Instance details

Defined in Apecs.Core

Methods

liftIO :: IO a -> SystemT w m a #

type System w a = SystemT w IO a Source #

class Elem (Storage c) ~ c => Component c Source #

A component is defined by specifying how it is stored. The constraint ensures that stores and components are mapped one-to-one.

Associated Types

type Storage c Source #

Instances
Component () Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage () :: * Source #

Component Entity Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage Entity :: * Source #

Component EntityCounter Source # 
Instance details

Defined in Apecs.Util

Associated Types

type Storage EntityCounter :: * Source #

Component c => Component (Maybe c) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (Maybe c) :: * Source #

Component c => Component (Identity c) Source #

Identity component/store. Identity c is equivalent to c, so using it is mostly useless.

Instance details

Defined in Apecs.Core

Associated Types

type Storage (Identity c) :: * Source #

Component c => Component (Filter c) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (Filter c) :: * Source #

Component c => Component (Not c) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (Not c) :: * Source #

(Component ca, Component cb) => Component (Either ca cb) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (Either ca cb) :: * Source #

(Component t_0, Component t_1) => Component (t_0, t_1) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (t_0, t_1) :: * Source #

(Component t_0, Component t_1, Component t_2) => Component (t_0, t_1, t_2) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (t_0, t_1, t_2) :: * Source #

(Component t_0, Component t_1, Component t_2, Component t_3) => Component (t_0, t_1, t_2, t_3) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (t_0, t_1, t_2, t_3) :: * Source #

(Component t_0, Component t_1, Component t_2, Component t_3, Component t_4) => Component (t_0, t_1, t_2, t_3, t_4) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (t_0, t_1, t_2, t_3, t_4) :: * Source #

(Component t_0, Component t_1, Component t_2, Component t_3, Component t_4, Component t_5) => Component (t_0, t_1, t_2, t_3, t_4, t_5) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (t_0, t_1, t_2, t_3, t_4, t_5) :: * Source #

(Component t_0, Component t_1, Component t_2, Component t_3, Component t_4, Component t_5, Component t_6) => Component (t_0, t_1, t_2, t_3, t_4, t_5, t_6) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (t_0, t_1, t_2, t_3, t_4, t_5, t_6) :: * Source #

(Component t_0, Component t_1, Component t_2, Component t_3, Component t_4, Component t_5, Component t_6, Component t_7) => Component (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) :: * Source #

class (Monad m, Component c) => Has w m c where Source #

Has w m c means that world w can produce a Storage c.

Minimal complete definition

getStore

Methods

getStore :: SystemT w m (Storage c) Source #

Instances
Monad m => Has w m Entity Source # 
Instance details

Defined in Apecs.Core

Monad m => Has w m () Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage ()) Source #

Has w m c => Has w m (Identity c) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (Identity c)) Source #

Has w m c => Has w m (Filter c) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (Filter c)) Source #

Has w m c => Has w m (Maybe c) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (Maybe c)) Source #

Has w m c => Has w m (Not c) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (Not c)) Source #

(Has w m ca, Has w m cb) => Has w m (Either ca cb) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (Either ca cb)) Source #

(Has w m t_0, Has w m t_1) => Has w m (t_0, t_1) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (t_0, t_1)) Source #

(Has w m t_0, Has w m t_1, Has w m t_2) => Has w m (t_0, t_1, t_2) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (t_0, t_1, t_2)) Source #

(Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3) => Has w m (t_0, t_1, t_2, t_3) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (t_0, t_1, t_2, t_3)) Source #

(Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3, Has w m t_4) => Has w m (t_0, t_1, t_2, t_3, t_4) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (t_0, t_1, t_2, t_3, t_4)) Source #

(Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3, Has w m t_4, Has w m t_5) => Has w m (t_0, t_1, t_2, t_3, t_4, t_5) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (t_0, t_1, t_2, t_3, t_4, t_5)) Source #

(Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3, Has w m t_4, Has w m t_5, Has w m t_6) => Has w m (t_0, t_1, t_2, t_3, t_4, t_5, t_6) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (t_0, t_1, t_2, t_3, t_4, t_5, t_6)) Source #

(Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3, Has w m t_4, Has w m t_5, Has w m t_6, Has w m t_7) => Has w m (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7)) Source #

type family Elem s Source #

The type of components stored by a store, e.g. Elem (Map c) = c.

Instances
type Elem () Source # 
Instance details

Defined in Apecs.Core

type Elem () = ()
type Elem EntityStore Source # 
Instance details

Defined in Apecs.Core

type Elem (Identity s) Source # 
Instance details

Defined in Apecs.Core

type Elem (Identity s) = Identity (Elem s)
type Elem (FilterStore s) Source # 
Instance details

Defined in Apecs.Core

type Elem (FilterStore s) = Filter (Elem s)
type Elem (MaybeStore s) Source # 
Instance details

Defined in Apecs.Core

type Elem (MaybeStore s) = Maybe (Elem s)
type Elem (NotStore s) Source # 
Instance details

Defined in Apecs.Core

type Elem (NotStore s) = Not (Elem s)
type Elem (Global c) Source # 
Instance details

Defined in Apecs.Stores

type Elem (Global c) = c
type Elem (Unique c) Source # 
Instance details

Defined in Apecs.Stores

type Elem (Unique c) = c
type Elem (Map c) Source # 
Instance details

Defined in Apecs.Stores

type Elem (Map c) = c
type Elem (t_0, t_1) Source # 
Instance details

Defined in Apecs.Core

type Elem (t_0, t_1) = (Elem t_0, Elem t_1)
type Elem (EitherStore sa sb) Source # 
Instance details

Defined in Apecs.Core

type Elem (EitherStore sa sb) = Either (Elem sa) (Elem sb)
type Elem (Cache n s) Source # 
Instance details

Defined in Apecs.Stores

type Elem (Cache n s) = Elem s
type Elem (t_0, t_1, t_2) Source # 
Instance details

Defined in Apecs.Core

type Elem (t_0, t_1, t_2) = (Elem t_0, Elem t_1, Elem t_2)
type Elem (t_0, t_1, t_2, t_3) Source # 
Instance details

Defined in Apecs.Core

type Elem (t_0, t_1, t_2, t_3) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3)
type Elem (t_0, t_1, t_2, t_3, t_4) Source # 
Instance details

Defined in Apecs.Core

type Elem (t_0, t_1, t_2, t_3, t_4) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3, Elem t_4)
type Elem (t_0, t_1, t_2, t_3, t_4, t_5) Source # 
Instance details

Defined in Apecs.Core

type Elem (t_0, t_1, t_2, t_3, t_4, t_5) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3, Elem t_4, Elem t_5)
type Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6) Source # 
Instance details

Defined in Apecs.Core

type Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3, Elem t_4, Elem t_5, Elem t_6)
type Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) Source # 
Instance details

Defined in Apecs.Core

type Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3, Elem t_4, Elem t_5, Elem t_6, Elem t_7)

class ExplInit m s where Source #

Indicates that the store s can be initialized. Generally, "base" stores like Map c can be initialized, but composite stores like MaybeStore s cannot.

Minimal complete definition

explInit

Methods

explInit :: m s Source #

Initialize a new empty store.

Instances
Monoid c => ExplInit IO (Global c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explInit :: IO (Global c) Source #

ExplInit IO (Unique c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explInit :: IO (Unique c) Source #

ExplInit IO (Map c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explInit :: IO (Map c) Source #

(ExplInit IO s, KnownNat n, Cachable s) => ExplInit IO (Cache n s) Source # 
Instance details

Defined in Apecs.Stores

Methods

explInit :: IO (Cache n s) Source #

class Monad m => ExplGet m s where Source #

Stores that we can read using explGet and explExists. For some entity e, eplGet s e is only guaranteed to be safe if explExists s e returns True.

Minimal complete definition

explGet, explExists

Methods

explGet :: s -> Int -> m (Elem s) Source #

Reads a component from the store. What happens if the component does not exist is left undefined, and might not necessarily crash.

explExists :: s -> Int -> m Bool Source #

Returns whether there is a component for the given index.

Instances
Monad m => ExplGet m EntityStore Source # 
Instance details

Defined in Apecs.Core

Monad m => ExplGet m () Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: () -> Int -> m (Elem ()) Source #

explExists :: () -> Int -> m Bool Source #

ExplGet IO (Global c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explGet :: Global c -> Int -> IO (Elem (Global c)) Source #

explExists :: Global c -> Int -> IO Bool Source #

ExplGet IO (Unique c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explGet :: Unique c -> Int -> IO (Elem (Unique c)) Source #

explExists :: Unique c -> Int -> IO Bool Source #

ExplGet IO (Map c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explGet :: Map c -> Int -> IO (Elem (Map c)) Source #

explExists :: Map c -> Int -> IO Bool Source #

ExplGet m s => ExplGet m (Identity s) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: Identity s -> Int -> m (Elem (Identity s)) Source #

explExists :: Identity s -> Int -> m Bool Source #

ExplGet m s => ExplGet m (FilterStore s) Source # 
Instance details

Defined in Apecs.Core

ExplGet m s => ExplGet m (MaybeStore s) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: MaybeStore s -> Int -> m (Elem (MaybeStore s)) Source #

explExists :: MaybeStore s -> Int -> m Bool Source #

ExplGet m s => ExplGet m (NotStore s) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: NotStore s -> Int -> m (Elem (NotStore s)) Source #

explExists :: NotStore s -> Int -> m Bool Source #

ExplGet IO s => ExplGet IO (Cache n s) Source # 
Instance details

Defined in Apecs.Stores

Methods

explGet :: Cache n s -> Int -> IO (Elem (Cache n s)) Source #

explExists :: Cache n s -> Int -> IO Bool Source #

(ExplGet m sa, ExplGet m sb) => ExplGet m (EitherStore sa sb) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: EitherStore sa sb -> Int -> m (Elem (EitherStore sa sb)) Source #

explExists :: EitherStore sa sb -> Int -> m Bool Source #

(ExplGet m t_0, ExplGet m t_1) => ExplGet m (t_0, t_1) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: (t_0, t_1) -> Int -> m (Elem (t_0, t_1)) Source #

explExists :: (t_0, t_1) -> Int -> m Bool Source #

(ExplGet m t_0, ExplGet m t_1, ExplGet m t_2) => ExplGet m (t_0, t_1, t_2) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: (t_0, t_1, t_2) -> Int -> m (Elem (t_0, t_1, t_2)) Source #

explExists :: (t_0, t_1, t_2) -> Int -> m Bool Source #

(ExplGet m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3) => ExplGet m (t_0, t_1, t_2, t_3) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: (t_0, t_1, t_2, t_3) -> Int -> m (Elem (t_0, t_1, t_2, t_3)) Source #

explExists :: (t_0, t_1, t_2, t_3) -> Int -> m Bool Source #

(ExplGet m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3, ExplGet m t_4) => ExplGet m (t_0, t_1, t_2, t_3, t_4) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: (t_0, t_1, t_2, t_3, t_4) -> Int -> m (Elem (t_0, t_1, t_2, t_3, t_4)) Source #

explExists :: (t_0, t_1, t_2, t_3, t_4) -> Int -> m Bool Source #

(ExplGet m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3, ExplGet m t_4, ExplGet m t_5) => ExplGet m (t_0, t_1, t_2, t_3, t_4, t_5) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: (t_0, t_1, t_2, t_3, t_4, t_5) -> Int -> m (Elem (t_0, t_1, t_2, t_3, t_4, t_5)) Source #

explExists :: (t_0, t_1, t_2, t_3, t_4, t_5) -> Int -> m Bool Source #

(ExplGet m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3, ExplGet m t_4, ExplGet m t_5, ExplGet m t_6) => ExplGet m (t_0, t_1, t_2, t_3, t_4, t_5, t_6) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6) -> Int -> m (Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6)) Source #

explExists :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6) -> Int -> m Bool Source #

(ExplGet m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3, ExplGet m t_4, ExplGet m t_5, ExplGet m t_6, ExplGet m t_7) => ExplGet m (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) -> Int -> m (Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7)) Source #

explExists :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) -> Int -> m Bool Source #

class Monad m => ExplSet m s where Source #

Stores that can be written.

Minimal complete definition

explSet

Methods

explSet :: s -> Int -> Elem s -> m () Source #

Writes a component to the store.

Instances
Monad m => ExplSet m () Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: () -> Int -> Elem () -> m () Source #

ExplSet IO (Global c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explSet :: Global c -> Int -> Elem (Global c) -> IO () Source #

ExplSet IO (Unique c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explSet :: Unique c -> Int -> Elem (Unique c) -> IO () Source #

ExplSet IO (Map c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explSet :: Map c -> Int -> Elem (Map c) -> IO () Source #

ExplSet m s => ExplSet m (Identity s) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: Identity s -> Int -> Elem (Identity s) -> m () Source #

(ExplDestroy m s, ExplSet m s) => ExplSet m (MaybeStore s) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: MaybeStore s -> Int -> Elem (MaybeStore s) -> m () Source #

ExplDestroy m s => ExplSet m (NotStore s) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: NotStore s -> Int -> Elem (NotStore s) -> m () Source #

ExplSet IO s => ExplSet IO (Cache n s) Source # 
Instance details

Defined in Apecs.Stores

Methods

explSet :: Cache n s -> Int -> Elem (Cache n s) -> IO () Source #

(ExplSet m sa, ExplSet m sb) => ExplSet m (EitherStore sa sb) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: EitherStore sa sb -> Int -> Elem (EitherStore sa sb) -> m () Source #

(ExplSet m t_0, ExplSet m t_1) => ExplSet m (t_0, t_1) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: (t_0, t_1) -> Int -> Elem (t_0, t_1) -> m () Source #

(ExplSet m t_0, ExplSet m t_1, ExplSet m t_2) => ExplSet m (t_0, t_1, t_2) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: (t_0, t_1, t_2) -> Int -> Elem (t_0, t_1, t_2) -> m () Source #

(ExplSet m t_0, ExplSet m t_1, ExplSet m t_2, ExplSet m t_3) => ExplSet m (t_0, t_1, t_2, t_3) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: (t_0, t_1, t_2, t_3) -> Int -> Elem (t_0, t_1, t_2, t_3) -> m () Source #

(ExplSet m t_0, ExplSet m t_1, ExplSet m t_2, ExplSet m t_3, ExplSet m t_4) => ExplSet m (t_0, t_1, t_2, t_3, t_4) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: (t_0, t_1, t_2, t_3, t_4) -> Int -> Elem (t_0, t_1, t_2, t_3, t_4) -> m () Source #

(ExplSet m t_0, ExplSet m t_1, ExplSet m t_2, ExplSet m t_3, ExplSet m t_4, ExplSet m t_5) => ExplSet m (t_0, t_1, t_2, t_3, t_4, t_5) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: (t_0, t_1, t_2, t_3, t_4, t_5) -> Int -> Elem (t_0, t_1, t_2, t_3, t_4, t_5) -> m () Source #

(ExplSet m t_0, ExplSet m t_1, ExplSet m t_2, ExplSet m t_3, ExplSet m t_4, ExplSet m t_5, ExplSet m t_6) => ExplSet m (t_0, t_1, t_2, t_3, t_4, t_5, t_6) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6) -> Int -> Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6) -> m () Source #

(ExplSet m t_0, ExplSet m t_1, ExplSet m t_2, ExplSet m t_3, ExplSet m t_4, ExplSet m t_5, ExplSet m t_6, ExplSet m t_7) => ExplSet m (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) -> Int -> Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) -> m () Source #

class Monad m => ExplDestroy m s where Source #

Stores that components can be removed from.

Minimal complete definition

explDestroy

Methods

explDestroy :: s -> Int -> m () Source #

Destroys the component for a given index.

Instances
Monad m => ExplDestroy m () Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: () -> Int -> m () Source #

ExplDestroy IO (Unique c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explDestroy :: Unique c -> Int -> IO () Source #

ExplDestroy IO (Map c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explDestroy :: Map c -> Int -> IO () Source #

ExplDestroy m s => ExplDestroy m (Identity s) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: Identity s -> Int -> m () Source #

ExplDestroy IO s => ExplDestroy IO (Cache n s) Source # 
Instance details

Defined in Apecs.Stores

Methods

explDestroy :: Cache n s -> Int -> IO () Source #

(ExplDestroy m sa, ExplDestroy m sb) => ExplDestroy m (EitherStore sa sb) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: EitherStore sa sb -> Int -> m () Source #

(ExplDestroy m t_0, ExplDestroy m t_1) => ExplDestroy m (t_0, t_1) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: (t_0, t_1) -> Int -> m () Source #

(ExplDestroy m t_0, ExplDestroy m t_1, ExplDestroy m t_2) => ExplDestroy m (t_0, t_1, t_2) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: (t_0, t_1, t_2) -> Int -> m () Source #

(ExplDestroy m t_0, ExplDestroy m t_1, ExplDestroy m t_2, ExplDestroy m t_3) => ExplDestroy m (t_0, t_1, t_2, t_3) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: (t_0, t_1, t_2, t_3) -> Int -> m () Source #

(ExplDestroy m t_0, ExplDestroy m t_1, ExplDestroy m t_2, ExplDestroy m t_3, ExplDestroy m t_4) => ExplDestroy m (t_0, t_1, t_2, t_3, t_4) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: (t_0, t_1, t_2, t_3, t_4) -> Int -> m () Source #

(ExplDestroy m t_0, ExplDestroy m t_1, ExplDestroy m t_2, ExplDestroy m t_3, ExplDestroy m t_4, ExplDestroy m t_5) => ExplDestroy m (t_0, t_1, t_2, t_3, t_4, t_5) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: (t_0, t_1, t_2, t_3, t_4, t_5) -> Int -> m () Source #

(ExplDestroy m t_0, ExplDestroy m t_1, ExplDestroy m t_2, ExplDestroy m t_3, ExplDestroy m t_4, ExplDestroy m t_5, ExplDestroy m t_6) => ExplDestroy m (t_0, t_1, t_2, t_3, t_4, t_5, t_6) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6) -> Int -> m () Source #

(ExplDestroy m t_0, ExplDestroy m t_1, ExplDestroy m t_2, ExplDestroy m t_3, ExplDestroy m t_4, ExplDestroy m t_5, ExplDestroy m t_6, ExplDestroy m t_7) => ExplDestroy m (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) -> Int -> m () Source #

class Monad m => ExplMembers m s where Source #

Stores that we can request a list of member entities for.

Minimal complete definition

explMembers

Methods

explMembers :: s -> m (Vector Int) Source #

Returns an unboxed vector of member indices

Instances
ExplMembers IO (Unique c) Source # 
Instance details

Defined in Apecs.Stores

ExplMembers IO (Map c) Source # 
Instance details

Defined in Apecs.Stores

Methods

explMembers :: Map c -> IO (Vector Int) Source #

ExplMembers m s => ExplMembers m (Identity s) Source # 
Instance details

Defined in Apecs.Core

Methods

explMembers :: Identity s -> m (Vector Int) Source #

ExplMembers m s => ExplMembers m (FilterStore s) Source # 
Instance details

Defined in Apecs.Core

ExplMembers IO s => ExplMembers IO (Cache n s) Source # 
Instance details

Defined in Apecs.Stores

Methods

explMembers :: Cache n s -> IO (Vector Int) Source #

(ExplMembers m t_0, ExplGet m t_1) => ExplMembers m (t_0, t_1) Source # 
Instance details

Defined in Apecs.Core

Methods

explMembers :: (t_0, t_1) -> m (Vector Int) Source #

(ExplMembers m t_0, ExplGet m t_1, ExplGet m t_2) => ExplMembers m (t_0, t_1, t_2) Source # 
Instance details

Defined in Apecs.Core

Methods

explMembers :: (t_0, t_1, t_2) -> m (Vector Int) Source #

(ExplMembers m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3) => ExplMembers m (t_0, t_1, t_2, t_3) Source # 
Instance details

Defined in Apecs.Core

Methods

explMembers :: (t_0, t_1, t_2, t_3) -> m (Vector Int) Source #

(ExplMembers m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3, ExplGet m t_4) => ExplMembers m (t_0, t_1, t_2, t_3, t_4) Source # 
Instance details

Defined in Apecs.Core

Methods

explMembers :: (t_0, t_1, t_2, t_3, t_4) -> m (Vector Int) Source #

(ExplMembers m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3, ExplGet m t_4, ExplGet m t_5) => ExplMembers m (t_0, t_1, t_2, t_3, t_4, t_5) Source # 
Instance details

Defined in Apecs.Core

Methods

explMembers :: (t_0, t_1, t_2, t_3, t_4, t_5) -> m (Vector Int) Source #

(ExplMembers m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3, ExplGet m t_4, ExplGet m t_5, ExplGet m t_6) => ExplMembers m (t_0, t_1, t_2, t_3, t_4, t_5, t_6) Source # 
Instance details

Defined in Apecs.Core

Methods

explMembers :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6) -> m (Vector Int) Source #

(ExplMembers m t_0, ExplGet m t_1, ExplGet m t_2, ExplGet m t_3, ExplGet m t_4, ExplGet m t_5, ExplGet m t_6, ExplGet m t_7) => ExplMembers m (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) Source # 
Instance details

Defined in Apecs.Core

Methods

explMembers :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) -> m (Vector Int) Source #

type Get w m c = (Has w m c, ExplGet m (Storage c)) Source #

type Set w m c = (Has w m c, ExplSet m (Storage c)) Source #

type Members w m c = (Has w m c, ExplMembers m (Storage c)) Source #

type Destroy w m c = (Has w m c, ExplDestroy m (Storage c)) Source #

data Not a Source #

Psuedocomponent indicating the absence of a. Mainly used as e.g. cmap $ (a, Not b) -> c to iterate over entities with an a but no b. Can also be used to delete components, like cmap $ a -> (Not :: Not a) to delete every a component.

Constructors

Not 
Instances
Has w m c => Has w m (Not c) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (Not c)) Source #

Component c => Component (Not c) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (Not c) :: * Source #

type Storage (Not c) Source # 
Instance details

Defined in Apecs.Core

type Storage (Not c) = NotStore (Storage c)

newtype NotStore s Source #

Pseudostore used to produce values of type Not a, inverts explExists, and destroys instead of explSet.

Constructors

NotStore s 
Instances
ExplDestroy m s => ExplSet m (NotStore s) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: NotStore s -> Int -> Elem (NotStore s) -> m () Source #

ExplGet m s => ExplGet m (NotStore s) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: NotStore s -> Int -> m (Elem (NotStore s)) Source #

explExists :: NotStore s -> Int -> m Bool Source #

type Elem (NotStore s) Source # 
Instance details

Defined in Apecs.Core

type Elem (NotStore s) = Not (Elem s)

newtype MaybeStore s Source #

Pseudostore used to produce values of type Maybe a. Will always return True for explExists. Writing can both set and delete a component using Just and Nothing respectively.

Constructors

MaybeStore s 
Instances
(ExplDestroy m s, ExplSet m s) => ExplSet m (MaybeStore s) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: MaybeStore s -> Int -> Elem (MaybeStore s) -> m () Source #

ExplGet m s => ExplGet m (MaybeStore s) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: MaybeStore s -> Int -> m (Elem (MaybeStore s)) Source #

explExists :: MaybeStore s -> Int -> m Bool Source #

type Elem (MaybeStore s) Source # 
Instance details

Defined in Apecs.Core

type Elem (MaybeStore s) = Maybe (Elem s)

data EitherStore sa sb Source #

Used for Either, a logical disjunction between two components. As expected, Either is used to model error values. Getting an Either a b will first attempt to get a b and return it as Right b, or if it does not exist, get an a as Left a. Can also be used to set one of two things.

Constructors

EitherStore sa sb 
Instances
(ExplDestroy m sa, ExplDestroy m sb) => ExplDestroy m (EitherStore sa sb) Source # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: EitherStore sa sb -> Int -> m () Source #

(ExplSet m sa, ExplSet m sb) => ExplSet m (EitherStore sa sb) Source # 
Instance details

Defined in Apecs.Core

Methods

explSet :: EitherStore sa sb -> Int -> Elem (EitherStore sa sb) -> m () Source #

(ExplGet m sa, ExplGet m sb) => ExplGet m (EitherStore sa sb) Source # 
Instance details

Defined in Apecs.Core

Methods

explGet :: EitherStore sa sb -> Int -> m (Elem (EitherStore sa sb)) Source #

explExists :: EitherStore sa sb -> Int -> m Bool Source #

type Elem (EitherStore sa sb) Source # 
Instance details

Defined in Apecs.Core

type Elem (EitherStore sa sb) = Either (Elem sa) (Elem sb)

data Filter c Source #

Pseudocomponent that functions normally for explExists and explMembers, but always return Filter for explGet. Can be used in cmap as cmap $ (Filter :: Filter a) -> b. Since the above can be written more consicely as cmap $ (_ :: a) -> b, it is rarely directly. More interestingly, we can define reusable filters like movables = Filter :: Filter (Position, Velocity).

Constructors

Filter 
Instances
Has w m c => Has w m (Filter c) Source # 
Instance details

Defined in Apecs.Core

Methods

getStore :: SystemT w m (Storage (Filter c)) Source #

Eq (Filter c) Source # 
Instance details

Defined in Apecs.Core

Methods

(==) :: Filter c -> Filter c -> Bool #

(/=) :: Filter c -> Filter c -> Bool #

Show (Filter c) Source # 
Instance details

Defined in Apecs.Core

Methods

showsPrec :: Int -> Filter c -> ShowS #

show :: Filter c -> String #

showList :: [Filter c] -> ShowS #

Component c => Component (Filter c) Source # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (Filter c) :: * Source #

type Storage (Filter c) Source # 
Instance details

Defined in Apecs.Core

newtype FilterStore s Source #

Constructors

FilterStore s 
Instances
ExplMembers m s => ExplMembers m (FilterStore s) Source # 
Instance details

Defined in Apecs.Core

ExplGet m s => ExplGet m (FilterStore s) Source # 
Instance details

Defined in Apecs.Core

type Elem (FilterStore s) Source # 
Instance details

Defined in Apecs.Core

type Elem (FilterStore s) = Filter (Elem s)

data EntityStore Source #

Pseudostore used to produce components of type Entity. Always returns True for explExists, and echoes back the entity argument for explGet. Used in e.g. cmap $ (a, ety :: Entity) -> b to access the current entity.

Constructors

EntityStore 
Instances
Monad m => ExplGet m EntityStore Source # 
Instance details

Defined in Apecs.Core

type Elem EntityStore Source # 
Instance details

Defined in Apecs.Core