Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Entity = Entity {}
- newtype System w a = System {}
- class Elem (Storage c) ~ c => Component c where
- type Storage c
- class Component c => Has w c where
- type family Elem s
- class ExplInit s where
- class ExplGet s where
- class ExplSet s where
- class ExplDestroy s where
- class ExplMembers s where
- 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 = Not
- newtype NotStore s = NotStore s
- newtype MaybeStore s = MaybeStore s
- data Filter c = Filter
- newtype FilterStore s = FilterStore s
- data EntityStore = EntityStore
Documentation
An Entity is just an integer, used to index into a component store.
A System is a newtype around `ReaderT w IO a`, where w
is the game world variable.
class Elem (Storage c) ~ c => Component c Source #
A component is defined by the type of its storage The storage in turn supplies runtime types for the component. For the component to be valid, its Storage must be an instance of Store.
Instances
class Component c => Has w c where Source #
A world Has
a component if it can produce its Storage
Instances
Has w Entity Source # | |
Has w c => Has w (Identity c) Source # | |
Has w c => Has w (Filter c) Source # | |
Has w c => Has w (Maybe c) Source # | |
Has w c => Has w (Not c) Source # | |
(Has w t_0, Has w t_1) => Has w (t_0, t_1) Source # | |
(Has w t_0, Has w t_1, Has w t_2) => Has w (t_0, t_1, t_2) Source # | |
(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) Source # | |
(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) Source # | |
(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) Source # | |
(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) Source # | |
(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) Source # | |
The type of components stored by a Store
Instances
type Elem EntityStore Source # | |
Defined in Apecs.Core | |
type Elem (Identity s) Source # | |
Defined in Apecs.Core | |
type Elem (FilterStore s) Source # | |
Defined in Apecs.Core | |
type Elem (MaybeStore s) Source # | |
Defined in Apecs.Core | |
type Elem (NotStore s) Source # | |
Defined in Apecs.Core | |
type Elem (Global c) Source # | |
Defined in Apecs.Stores | |
type Elem (Unique c) Source # | |
Defined in Apecs.Stores | |
type Elem (Map c) Source # | |
Defined in Apecs.Stores | |
type Elem (t_0, t_1) Source # | |
Defined in Apecs.Core | |
type Elem (Cache n s) Source # | |
Defined in Apecs.Stores | |
type Elem (t_0, t_1, t_2) Source # | |
Defined in Apecs.Core | |
type Elem (t_0, t_1, t_2, t_3) Source # | |
type Elem (t_0, t_1, t_2, t_3, t_4) Source # | |
type Elem (t_0, t_1, t_2, t_3, t_4, t_5) Source # | |
type Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6) Source # | |
type Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) Source # | |
class ExplInit s where Source #
Holds components indexed by entities
class ExplGet s where Source #
Stores that support get
and exists
in the IO monad
If existsIO
explGet :: s -> Int -> IO (Elem s) Source #
Reads a component from the store. What happens if the component does not exist is left undefined.
explExists :: s -> Int -> IO Bool Source #
Returns whether there is a component for the given index
Instances
class ExplSet s where Source #
Instances
class ExplDestroy s where Source #
explDestroy :: s -> Int -> IO () Source #
Destroys the component for a given index.
Instances
ExplDestroy s => ExplDestroy (Identity s) Source # | |
Defined in Apecs.Core | |
ExplDestroy (Unique c) Source # | |
Defined in Apecs.Stores | |
ExplDestroy (Map c) Source # | |
Defined in Apecs.Stores | |
(ExplDestroy t_0, ExplDestroy t_1) => ExplDestroy (t_0, t_1) Source # | |
Defined in Apecs.Core explDestroy :: (t_0, t_1) -> Int -> IO () Source # | |
ExplDestroy s => ExplDestroy (Cache n s) Source # | |
Defined in Apecs.Stores | |
(ExplDestroy t_0, ExplDestroy t_1, ExplDestroy t_2) => ExplDestroy (t_0, t_1, t_2) Source # | |
Defined in Apecs.Core explDestroy :: (t_0, t_1, t_2) -> Int -> IO () Source # | |
(ExplDestroy t_0, ExplDestroy t_1, ExplDestroy t_2, ExplDestroy t_3) => ExplDestroy (t_0, t_1, t_2, t_3) Source # | |
Defined in Apecs.Core explDestroy :: (t_0, t_1, t_2, t_3) -> Int -> IO () Source # | |
(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) Source # | |
Defined in Apecs.Core explDestroy :: (t_0, t_1, t_2, t_3, t_4) -> Int -> IO () Source # | |
(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) Source # | |
Defined in Apecs.Core explDestroy :: (t_0, t_1, t_2, t_3, t_4, t_5) -> Int -> IO () Source # | |
(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) Source # | |
Defined in Apecs.Core explDestroy :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6) -> Int -> IO () Source # | |
(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) Source # | |
Defined in Apecs.Core explDestroy :: (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) -> Int -> IO () Source # |
class ExplMembers s where Source #
Instances
Psuedocomponent indicating the absence of a
.
Pseudostore used to produce values of type Not a
NotStore s |
newtype MaybeStore s Source #
Pseudostore used to produce values of type Maybe a
Instances
(ExplDestroy s, ExplSet s) => ExplSet (MaybeStore s) Source # | |
Defined in Apecs.Core explSet :: MaybeStore s -> Int -> Elem (MaybeStore s) -> IO () Source # | |
ExplGet s => ExplGet (MaybeStore s) Source # | |
Defined in Apecs.Core explGet :: MaybeStore s -> Int -> IO (Elem (MaybeStore s)) Source # explExists :: MaybeStore s -> Int -> IO Bool Source # | |
type Elem (MaybeStore s) Source # | |
Defined in Apecs.Core |
newtype FilterStore s Source #
Instances
ExplGet s => ExplGet (FilterStore s) Source # | |
Defined in Apecs.Core explGet :: FilterStore s -> Int -> IO (Elem (FilterStore s)) Source # explExists :: FilterStore s -> Int -> IO Bool Source # | |
type Elem (FilterStore s) Source # | |
Defined in Apecs.Core |
data EntityStore Source #
Pseudostore used to produce components of type Entity
Instances
ExplGet EntityStore Source # | |
Defined in Apecs.Core explGet :: EntityStore -> Int -> IO (Elem EntityStore) Source # explExists :: EntityStore -> Int -> IO Bool Source # | |
type Elem EntityStore Source # | |
Defined in Apecs.Core |