| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Mischief.ECS.World.Utils
Synopsis
- processBundleElement :: World -> ComponentTicks -> BundleElement ErasedComponent -> IO ProcessedBundleElement
- processBundleElements :: World -> ComponentTicks -> Set (BundleElement ErasedComponent) -> IO ProcessedBundleData
- combineProcessedBundles :: ProcessedBundleData -> ProcessedBundleData -> ProcessedBundleData
- isInProcessedBundle :: ProcessedBundleData -> ComponentId -> Bool
- setChangedTickOfComponents :: ProcessedBundleData -> (ComponentId -> Bool) -> Tick -> ProcessedBundleData
- setAddedTickOfComponents :: ProcessedBundleData -> (ComponentId -> Bool) -> Tick -> ProcessedBundleData
- removeComponentFromProcessedBundle :: ComponentId -> ProcessedBundleData -> ProcessedBundleData
- tryGetEntityRelCollection :: Component c => World -> Entity -> IO (Maybe (Maybe [Result (Rel c)]))
- tryGetEntityComponent :: Component c => World -> Entity -> IO (Maybe (Maybe c))
- tryGetEntityRel :: Component c => Entity -> World -> Entity -> IO (Maybe (Maybe c))
- tryGetRelCollections :: Component c => World -> [ArchetypeId] -> IO [(Entity, [Result (Rel c)])]
- tryGetComponents :: Component c => World -> [ArchetypeId] -> IO [(Entity, Result c)]
- tryGetEntities :: World -> [ArchetypeId] -> IO [Entity]
- tryGetRels :: Component c => Entity -> World -> [ArchetypeId] -> IO [(Entity, Result (Rel c))]
- tryGetRelsMaybe :: Component c => Entity -> World -> [ArchetypeId] -> IO [(Entity, Maybe (Result (Rel c)))]
- tryGetComponentsMaybe :: Component c => World -> [ArchetypeId] -> IO [(Entity, Maybe (Result c))]
- tryGetTicks :: ComponentId -> World -> [ArchetypeId] -> IO [Maybe ComponentTicks]
- tryGetEntityTicks :: Entity -> ComponentId -> World -> IO (Maybe ComponentTicks)
- isAlive :: forall m w. MonadSystem w m => Entity -> m Bool
- expect :: HasCallStack => forall (m :: Type -> Type) w a. MonadSystem w m => Text -> Maybe a -> m a
- newtype GetSystem = GetSystem (forall c. Component c => Proxy c -> Entity -> System (Maybe c))
Documentation
processBundleElement :: World -> ComponentTicks -> BundleElement ErasedComponent -> IO ProcessedBundleElement Source #
Process a BundleElement, turning its TypeRep into a ComponentId.
processBundleElements :: World -> ComponentTicks -> Set (BundleElement ErasedComponent) -> IO ProcessedBundleData Source #
Process a set of BundleElements into a ProcessedBundleData.
combineProcessedBundles :: ProcessedBundleData -> ProcessedBundleData -> ProcessedBundleData Source #
Combine two ProcessedBundleDatas, merging their sets of elements.
isInProcessedBundle :: ProcessedBundleData -> ComponentId -> Bool Source #
Check if a ComponentId is inside a ProcessedBundleData.
setChangedTickOfComponents :: ProcessedBundleData -> (ComponentId -> Bool) -> Tick -> ProcessedBundleData Source #
Sets the change tick of certain elements of the bundle to the specified Tick.
setAddedTickOfComponents :: ProcessedBundleData -> (ComponentId -> Bool) -> Tick -> ProcessedBundleData Source #
Sets the added tick of certain elements of the bundle to the specified Tick.
removeComponentFromProcessedBundle :: ComponentId -> ProcessedBundleData -> ProcessedBundleData Source #
tryGetEntityRelCollection :: Component c => World -> Entity -> IO (Maybe (Maybe [Result (Rel c)])) Source #
tryGetRelCollections :: Component c => World -> [ArchetypeId] -> IO [(Entity, [Result (Rel c)])] Source #
tryGetComponents :: Component c => World -> [ArchetypeId] -> IO [(Entity, Result c)] Source #
tryGetEntities :: World -> [ArchetypeId] -> IO [Entity] Source #
tryGetRels :: Component c => Entity -> World -> [ArchetypeId] -> IO [(Entity, Result (Rel c))] Source #
tryGetRelsMaybe :: Component c => Entity -> World -> [ArchetypeId] -> IO [(Entity, Maybe (Result (Rel c)))] Source #
tryGetComponentsMaybe :: Component c => World -> [ArchetypeId] -> IO [(Entity, Maybe (Result c))] Source #
tryGetTicks :: ComponentId -> World -> [ArchetypeId] -> IO [Maybe ComponentTicks] Source #
tryGetEntityTicks :: Entity -> ComponentId -> World -> IO (Maybe ComponentTicks) Source #
expect :: HasCallStack => forall (m :: Type -> Type) w a. MonadSystem w m => Text -> Maybe a -> m a Source #