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 ()
- ($=) :: 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
- 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 ()
- ($~) :: forall w m c. (Get w m c, Set w m c) => Entity -> (c -> c) -> SystemT w m ()
- 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 ()
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.
($=) :: forall w m c. Set w m c => Entity -> c -> SystemT w m () infixr 2 Source #
set
operator
Writes a Component to a given Entity. Will overwrite existing Components.
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
destroy :: forall w m c. Destroy w m c => Entity -> Proxy c -> SystemT w m () Source #
Destroys component c
for the given entity.
modify :: forall w m c. (Get w m c, Set w m c) => Entity -> (c -> c) -> SystemT w m () Source #
Applies a function, if possible.
($~) :: forall w m c. (Get w m c, Set w m c) => Entity -> (c -> c) -> SystemT w m () infixr 2 Source #
modify
operator
Applies a function, if possible.
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.