apecs-0.4.1.1: Fast ECS framework for game programming

Safe HaskellNone
LanguageHaskell2010

Apecs.Core

Synopsis

Documentation

newtype Entity #

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
Eq Entity # 
Instance details

Defined in Apecs.Core

Methods

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

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

Num Entity # 
Instance details

Defined in Apecs.Core

Ord Entity # 
Instance details

Defined in Apecs.Core

Show Entity # 
Instance details

Defined in Apecs.Core

Component Entity # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage Entity :: * #

Has w Entity # 
Instance details

Defined in Apecs.Core

type Storage Entity # 
Instance details

Defined in Apecs.Core

newtype System w a #

A System 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

System 

Fields

Instances
Monad (System w) # 
Instance details

Defined in Apecs.Core

Methods

(>>=) :: System w a -> (a -> System w b) -> System w b #

(>>) :: System w a -> System w b -> System w b #

return :: a -> System w a #

fail :: String -> System w a #

Functor (System w) # 
Instance details

Defined in Apecs.Core

Methods

fmap :: (a -> b) -> System w a -> System w b #

(<$) :: a -> System w b -> System w a #

Applicative (System w) # 
Instance details

Defined in Apecs.Core

Methods

pure :: a -> System w a #

(<*>) :: System w (a -> b) -> System w a -> System w b #

liftA2 :: (a -> b -> c) -> System w a -> System w b -> System w c #

(*>) :: System w a -> System w b -> System w b #

(<*) :: System w a -> System w b -> System w a #

MonadIO (System w) # 
Instance details

Defined in Apecs.Core

Methods

liftIO :: IO a -> System w a #

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

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 #

Instances
Component () # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage () :: * #

Component Entity # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage Entity :: * #

Component EntityCounter # 
Instance details

Defined in Apecs.Util

Associated Types

type Storage EntityCounter :: * #

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

Defined in Apecs.Core

Associated Types

type Storage (Maybe c) :: * #

Component c => Component (Identity c) #

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) :: * #

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

Defined in Apecs.Core

Associated Types

type Storage (Filter c) :: * #

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

Defined in Apecs.Core

Associated Types

type Storage (Not c) :: * #

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

Defined in Apecs.Core

Associated Types

type Storage (Either ca cb) :: * #

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

Defined in Apecs.Core

Associated Types

type Storage (t_0, t_1) :: * #

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

Defined in Apecs.Core

Associated Types

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

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

Defined in Apecs.Core

Associated Types

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

(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) # 
Instance details

Defined in Apecs.Core

Associated Types

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

(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) # 
Instance details

Defined in Apecs.Core

Associated Types

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

(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) # 
Instance details

Defined in Apecs.Core

Associated Types

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

(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) # 
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) :: * #

class Component c => Has w c where #

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

Minimal complete definition

getStore

Methods

getStore :: System w (Storage c) #

Instances
Has w Entity # 
Instance details

Defined in Apecs.Core

Has w () # 
Instance details

Defined in Apecs.Core

Methods

getStore :: System w (Storage ()) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (Identity c)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (Filter c)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (Maybe c)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (Not c)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (Either ca cb)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (t_0, t_1)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (t_0, t_1, t_2)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (t_0, t_1, t_2, t_3)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (t_0, t_1, t_2, t_3, t_4)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (t_0, t_1, t_2, t_3, t_4, t_5)) #

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

Defined in Apecs.Core

Methods

getStore :: System w (Storage (t_0, t_1, t_2, t_3, t_4, t_5, t_6)) #

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

Defined in Apecs.Core

Methods

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

type family Elem s #

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

Instances
type Elem () # 
Instance details

Defined in Apecs.Core

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

Defined in Apecs.Core

type Elem (Identity s) # 
Instance details

Defined in Apecs.Core

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

Defined in Apecs.Core

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

Defined in Apecs.Core

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

Defined in Apecs.Core

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

Defined in Apecs.Stores

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

Defined in Apecs.Stores

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

Defined in Apecs.Stores

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

Defined in Apecs.Core

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

Defined in Apecs.Core

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

Defined in Apecs.Stores

type Elem (Cache n s) = Elem s
type Elem (t_0, t_1, t_2) # 
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) # 
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) # 
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) # 
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) # 
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) # 
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 s where #

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 :: IO s #

Initialize a new empty store.

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

Defined in Apecs.Stores

Methods

explInit :: IO (Global c) #

ExplInit (Unique c) # 
Instance details

Defined in Apecs.Stores

Methods

explInit :: IO (Unique c) #

ExplInit (Map c) # 
Instance details

Defined in Apecs.Stores

Methods

explInit :: IO (Map c) #

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

Defined in Apecs.Stores

Methods

explInit :: IO (Cache n s) #

class ExplGet s where #

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 -> IO (Elem s) #

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 -> IO Bool #

Returns whether there is a component for the given index.

Instances
ExplGet () # 
Instance details

Defined in Apecs.Core

Methods

explGet :: () -> Int -> IO (Elem ()) #

explExists :: () -> Int -> IO Bool #

ExplGet EntityStore # 
Instance details

Defined in Apecs.Core

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

Defined in Apecs.Core

Methods

explGet :: Identity s -> Int -> IO (Elem (Identity s)) #

explExists :: Identity s -> Int -> IO Bool #

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

Defined in Apecs.Core

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

Defined in Apecs.Core

Methods

explGet :: MaybeStore s -> Int -> IO (Elem (MaybeStore s)) #

explExists :: MaybeStore s -> Int -> IO Bool #

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

Defined in Apecs.Core

Methods

explGet :: NotStore s -> Int -> IO (Elem (NotStore s)) #

explExists :: NotStore s -> Int -> IO Bool #

ExplGet (Global c) # 
Instance details

Defined in Apecs.Stores

Methods

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

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

ExplGet (Unique c) # 
Instance details

Defined in Apecs.Stores

Methods

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

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

ExplGet (Map c) # 
Instance details

Defined in Apecs.Stores

Methods

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

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

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

Defined in Apecs.Core

Methods

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

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

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

Defined in Apecs.Core

Methods

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

explExists :: EitherStore sa sb -> Int -> IO Bool #

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

Defined in Apecs.Stores

Methods

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

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

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

Defined in Apecs.Core

Methods

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

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

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

Defined in Apecs.Core

Methods

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

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

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

Defined in Apecs.Core

Methods

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

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

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

Defined in Apecs.Core

Methods

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

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

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

Defined in Apecs.Core

Methods

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

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

(ExplGet t_0, ExplGet t_1, ExplGet t_2, ExplGet t_3, ExplGet t_4, ExplGet t_5, ExplGet t_6, ExplGet t_7) => ExplGet (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) # 
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 -> IO (Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7)) #

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

class ExplSet s where #

Stores that can be written.

Minimal complete definition

explSet

Methods

explSet :: s -> Int -> Elem s -> IO () #

Writes a component to the store.

Instances
ExplSet () # 
Instance details

Defined in Apecs.Core

Methods

explSet :: () -> Int -> Elem () -> IO () #

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

Defined in Apecs.Core

Methods

explSet :: Identity s -> Int -> Elem (Identity s) -> IO () #

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

Defined in Apecs.Core

Methods

explSet :: MaybeStore s -> Int -> Elem (MaybeStore s) -> IO () #

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

Defined in Apecs.Core

Methods

explSet :: NotStore s -> Int -> Elem (NotStore s) -> IO () #

ExplSet (Global c) # 
Instance details

Defined in Apecs.Stores

Methods

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

ExplSet (Unique c) # 
Instance details

Defined in Apecs.Stores

Methods

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

ExplSet (Map c) # 
Instance details

Defined in Apecs.Stores

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Stores

Methods

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

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

Defined in Apecs.Core

Methods

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

(ExplSet t_0, ExplSet t_1, ExplSet t_2, ExplSet t_3) => ExplSet (t_0, t_1, t_2, t_3) # 
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) -> IO () #

(ExplSet t_0, ExplSet t_1, ExplSet t_2, ExplSet t_3, ExplSet t_4) => ExplSet (t_0, t_1, t_2, t_3, t_4) # 
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) -> IO () #

(ExplSet t_0, ExplSet t_1, ExplSet t_2, ExplSet t_3, ExplSet t_4, ExplSet t_5) => ExplSet (t_0, t_1, t_2, t_3, t_4, t_5) # 
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) -> IO () #

(ExplSet t_0, ExplSet t_1, ExplSet t_2, ExplSet t_3, ExplSet t_4, ExplSet t_5, ExplSet t_6) => ExplSet (t_0, t_1, t_2, t_3, t_4, t_5, t_6) # 
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) -> IO () #

(ExplSet t_0, ExplSet t_1, ExplSet t_2, ExplSet t_3, ExplSet t_4, ExplSet t_5, ExplSet t_6, ExplSet t_7) => ExplSet (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) # 
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) -> IO () #

class ExplDestroy s where #

Stores that components can be removed from.

Minimal complete definition

explDestroy

Methods

explDestroy :: s -> Int -> IO () #

Destroys the component for a given index.

Instances
ExplDestroy () # 
Instance details

Defined in Apecs.Core

Methods

explDestroy :: () -> Int -> IO () #

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

Defined in Apecs.Core

Methods

explDestroy :: Identity s -> Int -> IO () #

ExplDestroy (Unique c) # 
Instance details

Defined in Apecs.Stores

Methods

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

ExplDestroy (Map c) # 
Instance details

Defined in Apecs.Stores

Methods

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

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

Defined in Apecs.Core

Methods

explDestroy :: (t_0, t_1) -> Int -> IO () #

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

Defined in Apecs.Stores

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

(ExplDestroy t_0, ExplDestroy t_1, ExplDestroy t_2, ExplDestroy t_3, ExplDestroy t_4, ExplDestroy t_5, ExplDestroy t_6, ExplDestroy t_7) => ExplDestroy (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) # 
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 -> IO () #

class ExplMembers s where #

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

Minimal complete definition

explMembers

Methods

explMembers :: s -> IO (Vector Int) #

Returns an unboxed vector of member indices

Instances
ExplMembers s => ExplMembers (Identity s) # 
Instance details

Defined in Apecs.Core

Methods

explMembers :: Identity s -> IO (Vector Int) #

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

Defined in Apecs.Core

ExplMembers (Unique c) # 
Instance details

Defined in Apecs.Stores

Methods

explMembers :: Unique c -> IO (Vector Int) #

ExplMembers (Map c) # 
Instance details

Defined in Apecs.Stores

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Stores

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

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

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

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

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

data Not a #

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 c => Has w (Not c) # 
Instance details

Defined in Apecs.Core

Methods

getStore :: System w (Storage (Not c)) #

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

Defined in Apecs.Core

Associated Types

type Storage (Not c) :: * #

type Storage (Not c) # 
Instance details

Defined in Apecs.Core

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

newtype NotStore s #

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

Constructors

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

Defined in Apecs.Core

Methods

explSet :: NotStore s -> Int -> Elem (NotStore s) -> IO () #

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

Defined in Apecs.Core

Methods

explGet :: NotStore s -> Int -> IO (Elem (NotStore s)) #

explExists :: NotStore s -> Int -> IO Bool #

type Elem (NotStore s) # 
Instance details

Defined in Apecs.Core

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

newtype MaybeStore s #

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 s, ExplSet s) => ExplSet (MaybeStore s) # 
Instance details

Defined in Apecs.Core

Methods

explSet :: MaybeStore s -> Int -> Elem (MaybeStore s) -> IO () #

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

Defined in Apecs.Core

Methods

explGet :: MaybeStore s -> Int -> IO (Elem (MaybeStore s)) #

explExists :: MaybeStore s -> Int -> IO Bool #

type Elem (MaybeStore s) # 
Instance details

Defined in Apecs.Core

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

data EitherStore sa sb #

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
(ExplSet sa, ExplSet sb) => ExplSet (EitherStore sa sb) # 
Instance details

Defined in Apecs.Core

Methods

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

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

Defined in Apecs.Core

Methods

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

explExists :: EitherStore sa sb -> Int -> IO Bool #

type Elem (EitherStore sa sb) # 
Instance details

Defined in Apecs.Core

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

data Filter c #

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 c => Has w (Filter c) # 
Instance details

Defined in Apecs.Core

Methods

getStore :: System w (Storage (Filter c)) #

Eq (Filter c) # 
Instance details

Defined in Apecs.Core

Methods

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

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

Show (Filter c) # 
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) # 
Instance details

Defined in Apecs.Core

Associated Types

type Storage (Filter c) :: * #

type Storage (Filter c) # 
Instance details

Defined in Apecs.Core

newtype FilterStore s #

Constructors

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

Defined in Apecs.Core

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

Defined in Apecs.Core

type Elem (FilterStore s) # 
Instance details

Defined in Apecs.Core

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

data EntityStore #

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
ExplGet EntityStore # 
Instance details

Defined in Apecs.Core

type Elem EntityStore # 
Instance details

Defined in Apecs.Core