| 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 [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, [Rel c])]
- tryGetComponents :: Component c => World -> [ArchetypeId] -> IO [(Entity, c)]
- tryGetEntities :: World -> [ArchetypeId] -> IO [Entity]
- tryGetRels :: Component c => Entity -> World -> [ArchetypeId] -> IO [(Entity, Rel c)]
- tryGetRelsMaybe :: Component c => Entity -> World -> [ArchetypeId] -> IO [(Entity, Maybe (Rel c))]
- tryGetComponentsMaybe :: Component c => World -> [ArchetypeId] -> IO [(Entity, Maybe 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
- 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 #
tryGetRelCollections :: Component c => World -> [ArchetypeId] -> IO [(Entity, [Rel c])] Source #
tryGetComponents :: Component c => World -> [ArchetypeId] -> IO [(Entity, c)] Source #
tryGetEntities :: World -> [ArchetypeId] -> IO [Entity] Source #
tryGetRels :: Component c => Entity -> World -> [ArchetypeId] -> IO [(Entity, Rel c)] Source #
tryGetRelsMaybe :: Component c => Entity -> World -> [ArchetypeId] -> IO [(Entity, Maybe (Rel c))] Source #
tryGetComponentsMaybe :: Component c => World -> [ArchetypeId] -> IO [(Entity, Maybe c)] Source #
tryGetTicks :: ComponentId -> World -> [ArchetypeId] -> IO [Maybe ComponentTicks] Source #
tryGetEntityTicks :: Entity -> ComponentId -> World -> IO (Maybe ComponentTicks) Source #