Safe Haskell | None |
---|---|
Language | Haskell2010 |
- runSystem :: System w a -> w -> IO a
- runWith :: w -> System w a -> IO a
- get :: forall w c. Has w c => Entity -> System w c
- set :: forall w c. Has w c => Entity -> c -> System w ()
- exists :: forall w c. Has w c => Entity -> c -> System w Bool
- cmap :: forall world cx cy. (Has world cx, Has world cy) => (cx -> cy) -> System world ()
- cmapM :: forall world c a. Has world c => (c -> System world a) -> System world [a]
- cmapM_ :: forall world c a. Has world c => (c -> System world a) -> System world ()
- destroy :: forall w c. Has w c => Entity -> c -> System w ()
- modify :: forall w c. Has w c => Entity -> (c -> c) -> System w ()
- count :: forall w c. Has w c => c -> System w Int
Documentation
set :: forall w c. Has 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. Has w c => Entity -> 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 world cx cy. (Has world cx, Has world cy) => (cx -> cy) -> System world () Source #
Maps a function over all entities with a cx
, and writes their cy
cmapM :: forall world c a. Has world c => (c -> System world a) -> System world [a] Source #
Monadically iterates over all entites with a cx
cmapM_ :: forall world c a. Has world c => (c -> System world a) -> System world () Source #
Monadically iterates over all entites with a cx
destroy :: forall w c. Has w c => Entity -> 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.