Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- runSystem :: System w a -> w -> IO a
- runWith :: w -> System w a -> IO a
- get :: forall w c. Get w c => Entity -> System w c
- set :: forall w c. Set w c => Entity -> c -> System w ()
- exists :: forall w c. Get w c => Entity -> Proxy c -> System w Bool
- cmap :: forall w cx cy. (Get w cx, Members w cx, Set w cy) => (cx -> cy) -> System w ()
- cmapM :: forall w cx cy. (Get w cx, Set w cy, Members w cx) => (cx -> System w cy) -> System w ()
- cmapM_ :: forall w c a. (Get w c, Members w c) => (c -> System w a) -> System w ()
- getAll :: forall w c. (Get w c, Members w c) => System w [c]
- destroy :: forall w c. Destroy w c => Entity -> Proxy c -> System w ()
- modify :: forall w c. (Get w c, Set w c) => Entity -> (c -> c) -> System w ()
- count :: forall w c. Members w c => c -> System w Int
Documentation
set :: forall w c. Set w c => Entity -> c -> System w () Source #
Writes a component to a given entity. Will overwrite existing components. The type was originally 'Entity c -> c -> System w ()', but is relaxed to 'Entity e' so you don't always have to write 'set . cast'
exists :: forall w c. Get w c => Entity -> Proxy c -> System w 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 cx cy. (Get w cx, Members w cx, Set w cy) => (cx -> cy) -> System w () Source #
Maps a function over all entities with a cx
, and writes their cy
cmapM :: forall w cx cy. (Get w cx, Set w cy, Members w cx) => (cx -> System w cy) -> System w () Source #
Monadically iterates over all entites with a cx, and writes their cy
cmapM_ :: forall w c a. (Get w c, Members w c) => (c -> System w a) -> System w () Source #
Monadically iterates over all entites with a cx
getAll :: forall w c. (Get w c, Members w c) => System w [c] Source #
Get all components c
.
Call as [(c,Entity)]
to read the entity/index.
destroy :: forall w c. Destroy w c => Entity -> Proxy c -> System w () 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.