Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- runSystem :: SystemT w m a -> w -> m a
- runWith :: w -> SystemT w m a -> m a
- get :: forall w m c. Get w m c => Entity -> SystemT w m c
- set :: forall w m c. Set w m c => Entity -> c -> SystemT w m ()
- exists :: forall w m c. Get w m c => Entity -> Proxy c -> SystemT w m Bool
- cmap :: forall w m cx cy. (Get w m cx, Members w m cx, Set w m cy) => (cx -> cy) -> SystemT w m ()
- cmapIf :: forall w m cp cx cy. (Get w m cx, Get w m cp, Members w m cx, Set w m cy) => (cp -> Bool) -> (cx -> cy) -> SystemT w m ()
- cmapM :: forall w m cx cy. (Get w m cx, Set w m cy, Members w m cx) => (cx -> SystemT w m cy) -> SystemT w m ()
- cmapM_ :: forall w m c a. (Get w m c, Members w m c) => (c -> SystemT w m a) -> SystemT w m ()
- cfold :: forall w m c a. (Members w m c, Get w m c) => (a -> c -> a) -> a -> SystemT w m a
- cfoldM :: forall w m c a. (Members w m c, Get w m c) => (a -> c -> SystemT w m a) -> a -> SystemT w m a
- cfoldM_ :: forall w m c a. (Members w m c, Get w m c) => (a -> c -> SystemT w m a) -> a -> SystemT w m ()
- getAll :: forall w m c. (Get w m c, Members w m c) => SystemT w m [c]
- destroy :: forall w m c. Destroy w m c => Entity -> Proxy c -> SystemT w m ()
- modify :: forall w m c. (Get w m c, Set w m c) => Entity -> (c -> c) -> SystemT w m ()
- count :: forall w m c. Members w m c => Proxy c -> SystemT w m Int
Documentation
set :: forall w m c. Set w m c => Entity -> c -> SystemT w m () Source #
Writes a component to a given entity. Will overwrite existing components. The type was originally 'Entity c -> c -> SystemT w m ()', but is relaxed to 'Entity e' so you don't always have to write 'set . cast'
exists :: forall w m c. Get w m c => Entity -> Proxy c -> SystemT w m Bool Source #
Returns whether the given entity has component c
Note that c
is a phantom argument, used only to convey the type of the entity to be queried.
cmap :: forall w m cx cy. (Get w m cx, Members w m cx, Set w m cy) => (cx -> cy) -> SystemT w m () Source #
Maps a function over all entities with a cx
, and writes their cy
.
cmapIf :: forall w m cp cx cy. (Get w m cx, Get w m cp, Members w m cx, Set w m cy) => (cp -> Bool) -> (cx -> cy) -> SystemT w m () Source #
Conditional cmap
, that first tests whether the argument satisfies some property.
The entity needs to have both a cx and cp component.
cmapM :: forall w m cx cy. (Get w m cx, Set w m cy, Members w m cx) => (cx -> SystemT w m cy) -> SystemT w m () Source #
Monadically iterates over all entites with a cx
, and writes their cy
.
cmapM_ :: forall w m c a. (Get w m c, Members w m c) => (c -> SystemT w m a) -> SystemT w m () Source #
Monadically iterates over all entites with a cx
cfold :: forall w m c a. (Members w m c, Get w m c) => (a -> c -> a) -> a -> SystemT w m a Source #
Fold over the game world; for example, cfold max (minBound :: Foo)
will find the maximum value of Foo
.
Strict in the accumulator.
cfoldM :: forall w m c a. (Members w m c, Get w m c) => (a -> c -> SystemT w m a) -> a -> SystemT w m a Source #
Monadically fold over the game world. Strict in the accumulator.
cfoldM_ :: forall w m c a. (Members w m c, Get w m c) => (a -> c -> SystemT w m a) -> a -> SystemT w m () Source #
Monadically fold over the game world. Strict in the accumulator.
getAll :: forall w m c. (Get w m c, Members w m c) => SystemT w m [c] Source #
Get all components c
.
Call as [(c,Entity)]
to also read the entity index.
destroy :: forall w m c. Destroy w m c => Entity -> Proxy c -> SystemT w m () Source #
Destroys component c
for the given entity.
Note that c
is a phantom argument, used only to convey the type of the entity to be destroyed.