apecs 0.3.0.1 → 0.3.0.2
raw patch · 3 files changed
+13/−2 lines, 3 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Apecs: getAll :: forall world c. Has world c => System world [c]
+ Apecs.System: getAll :: forall world c. Has world c => System world [c]
Files
- apecs.cabal +1/−1
- src/Apecs.hs +1/−1
- src/Apecs/System.hs +11/−0
apecs.cabal view
@@ -1,5 +1,5 @@ name: apecs-version: 0.3.0.1+version: 0.3.0.2 homepage: https://github.com/jonascarpay/apecs#readme license: BSD3 license-file: LICENSE
src/Apecs.hs view
@@ -11,7 +11,7 @@ initStore, -- * Systems- get, set,+ get, set, getAll, cmap, cmapM, cmapM_, modify, destroy, exists,
src/Apecs/System.hs view
@@ -79,6 +79,17 @@ x <- liftIO$ explGet s ety sys x +-- | Get all components @c@.+-- Call as @[(c,Entity)]@ to read the entity/index.+{-# INLINE getAll #-}+getAll :: forall world c. Has world c+ => System world [c]+getAll = do+ s :: Storage c <- getStore+ sl <- liftIO$ explMembers s+ forM (U.toList sl) $ liftIO . explGet s++ -- | 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. {-# INLINE destroy #-}