Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- runGC :: MonadIO m => SystemT w m ()
- global :: Entity
- newtype EntityCounter = EntityCounter {
- getCounter :: Sum Int
- nextEntity :: (MonadIO m, Get w m EntityCounter) => SystemT w m Entity
- newEntity :: (MonadIO m, Set w m c, Get w m EntityCounter) => c -> SystemT w m Entity
- newEntity_ :: (MonadIO m, Set world m component, Get world m EntityCounter) => component -> SystemT world m ()
Utility
Convenience entity, for use in places where the entity value does not matter, i.e. a global store.
EntityCounter
newtype EntityCounter Source #
Component used by newEntity to track the number of issued entities.
Automatically added to any world created with makeWorld
Instances
Component EntityCounter Source # | |
Defined in Apecs.Util type Storage EntityCounter Source # | |
Monoid EntityCounter Source # | |
Defined in Apecs.Util mempty :: EntityCounter # mappend :: EntityCounter -> EntityCounter -> EntityCounter # mconcat :: [EntityCounter] -> EntityCounter # | |
Semigroup EntityCounter Source # | |
Defined in Apecs.Util (<>) :: EntityCounter -> EntityCounter -> EntityCounter # sconcat :: NonEmpty EntityCounter -> EntityCounter # stimes :: Integral b => b -> EntityCounter -> EntityCounter # | |
Show EntityCounter Source # | |
Defined in Apecs.Util showsPrec :: Int -> EntityCounter -> ShowS # show :: EntityCounter -> String # showList :: [EntityCounter] -> ShowS # | |
Eq EntityCounter Source # | |
Defined in Apecs.Util (==) :: EntityCounter -> EntityCounter -> Bool # (/=) :: EntityCounter -> EntityCounter -> Bool # | |
type Storage EntityCounter Source # | |
Defined in Apecs.Util |
nextEntity :: (MonadIO m, Get w m EntityCounter) => SystemT w m Entity Source #
Bumps the EntityCounter and yields its value
newEntity :: (MonadIO m, Set w m c, Get w m EntityCounter) => c -> SystemT w m Entity Source #
Writes the given components to a new entity, and yields that entity. The return value is often ignored.
newEntity_ :: (MonadIO m, Set world m component, Get world m EntityCounter) => component -> SystemT world m () Source #
Writes the given components to a new entity without yelding the result. Used mostly for convenience.