Safe Haskell | None |
---|---|
Language | Haskell2010 |
- runSystem :: System w a -> w -> IO a
- runWith :: w -> System w a -> IO a
- owners :: forall w c. (Has w c, HasMembers (Storage c)) => System w (Slice c)
- exists :: forall w c. (Has w c, HasMembers (Storage c)) => Entity c -> System w Bool
- destroy :: forall w c. (Has w c, HasMembers (Storage c)) => Entity c -> System w ()
- resetStore :: forall w c p. (Has w c, HasMembers (Storage c)) => p c -> System w ()
- get :: forall w c. (Store (Storage c), Has w c) => Entity c -> System w (Safe c)
- set :: forall w c e. (IsRuntime c, Has w c) => Entity e -> c -> System w ()
- setOrDelete :: forall w c. (IsRuntime c, Has w c) => Entity c -> Safe c -> System w ()
- modify :: forall w c. (IsRuntime c, Has w c) => Entity c -> (c -> c) -> System w ()
- imapM_ :: forall w c. (Has w c, HasMembers (Storage c)) => (Entity c -> System w ()) -> System w ()
- imapM :: forall w c a. (Has w c, HasMembers (Storage c)) => (Entity c -> System w a) -> System w [a]
- cmap :: forall world c. (IsRuntime c, Has world c) => (c -> c) -> System world ()
- cmapM_ :: forall w c. (Has w c, IsRuntime c) => (c -> System w ()) -> System w ()
- cimapM_ :: forall w c. (Has w c, IsRuntime c) => ((Entity c, c) -> System w ()) -> System w ()
- cmapM :: forall w c a. (Has w c, IsRuntime c) => (c -> System w a) -> System w [a]
- cimapM :: forall w c a. (Has w c, IsRuntime c) => ((Entity c, c) -> System w a) -> System w [a]
- cmap' :: forall world c. (Has world c, IsRuntime c) => (c -> Safe c) -> System world ()
- rmap :: forall world r w. (Has world w, Has world r, IsRuntime w, IsRuntime r) => (r -> w) -> System world ()
- rmap' :: forall world r w. (Has world w, Has world r, Store (Storage w), IsRuntime r) => (r -> Safe w) -> System world ()
- wmap :: forall world r w. (Has world w, Has world r, IsRuntime w, IsRuntime r) => (Safe r -> w) -> System world ()
- wmap' :: forall world r w. (Has world w, Has world r, Store (Storage w), IsRuntime r) => (Safe r -> Safe w) -> System world ()
- slice :: forall w c q. (Query q (Storage c), Has w c) => q -> System w (Slice c)
- readGlobal :: forall w c. (Has w c, GlobalRW (Storage c) c) => System w c
- writeGlobal :: forall w c. (Has w c, GlobalRW (Storage c) c) => c -> System w ()
- modifyGlobal :: forall w c. (Has w c, GlobalRW (Storage c) c) => (c -> c) -> System w ()
Documentation
owners :: forall w c. (Has w c, HasMembers (Storage c)) => System w (Slice c) Source #
A slice containing all entities with component c
exists :: forall w c. (Has w c, HasMembers (Storage c)) => Entity c -> System w Bool Source #
Returns whether the given entity has component c
For composite components, this indicates whether the component
has all its constituents
destroy :: forall w c. (Has w c, HasMembers (Storage c)) => Entity c -> System w () Source #
Destroys the component c
for the given entity
resetStore :: forall w c p. (Has w c, HasMembers (Storage c)) => p c -> System w () Source #
Removes all components. Equivalent to manually iterating and deleting, but usually optimized.
get :: forall w c. (Store (Storage c), Has w c) => Entity c -> System w (Safe c) Source #
Gets the component for a given entity. This is a safe access, because the entity might not have the requested components.
set :: forall w c e. (IsRuntime c, Has w c) => Entity e -> c -> System w () Source #
Writes a component to a given entity. Will overwrite existing components.
setOrDelete :: forall w c. (IsRuntime c, Has w c) => Entity c -> Safe c -> System w () Source #
Same as set
, but uses Safe to possibly delete a component
modify :: forall w c. (IsRuntime c, Has w c) => Entity c -> (c -> c) -> System w () Source #
Applies a function if possible. Equivalent to reading, mapping, and writing, but stores can provide optimized implementations.
imapM_ :: forall w c. (Has w c, HasMembers (Storage c)) => (Entity c -> System w ()) -> System w () Source #
Monadically iterate a system over all entities that have that component. Note that writing to the store while iterating over it is undefined behaviour.
imapM :: forall w c a. (Has w c, HasMembers (Storage c)) => (Entity c -> System w a) -> System w [a] Source #
Monadically iterate a system over all entities that have that component. Note that writing to the store while iterating over it is undefined behaviour.
cmap :: forall world c. (IsRuntime c, Has world c) => (c -> c) -> System world () Source #
Maps a pure function over all components
cmapM_ :: forall w c. (Has w c, IsRuntime c) => (c -> System w ()) -> System w () Source #
mapM_ version of cmap
cimapM_ :: forall w c. (Has w c, IsRuntime c) => ((Entity c, c) -> System w ()) -> System w () Source #
indexed cmapM_, also gives the current entity.
cmapM :: forall w c a. (Has w c, IsRuntime c) => (c -> System w a) -> System w [a] Source #
mapM version of cmap. Can be used to get a list of entities
cimapM :: forall w c a. (Has w c, IsRuntime c) => ((Entity c, c) -> System w a) -> System w [a] Source #
indexed cmapM, also gives the current entity.
cmap' :: forall world c. (Has world c, IsRuntime c) => (c -> Safe c) -> System world () Source #
Maps a function that might delete its components
rmap :: forall world r w. (Has world w, Has world r, IsRuntime w, IsRuntime r) => (r -> w) -> System world () Source #
Maps a function over all entities with a r
, and writes their w
rmap' :: forall world r w. (Has world w, Has world r, Store (Storage w), IsRuntime r) => (r -> Safe w) -> System world () Source #
Maps a function over all entities with a r
, and writes or deletes their w
wmap :: forall world r w. (Has world w, Has world r, IsRuntime w, IsRuntime r) => (Safe r -> w) -> System world () Source #
For all entities with a w
, this map reads their r
and writes their w
wmap' :: forall world r w. (Has world w, Has world r, Store (Storage w), IsRuntime r) => (Safe r -> Safe w) -> System world () Source #
For all entities with a w
, this map reads their r
and writes or deletes their w
slice :: forall w c q. (Query q (Storage c), Has w c) => q -> System w (Slice c) Source #
Performs a query
readGlobal :: forall w c. (Has w c, GlobalRW (Storage c) c) => System w c Source #
Reads a global value