mischief-ecs
Safe HaskellNone
LanguageGHC2024

Mischief.ECS.World.Utils

Synopsis

Documentation

removeComponentFromProcessedBundle :: ComponentId -> ProcessedBundleData -> ProcessedBundleData Source #

Sets the change tick of certain elements of the bundle to the specified Tick. setChangedTickOfComponents :: ProcessedBundleData -> (ComponentId -> Bool) -> Tick -> ProcessedBundleData setChangedTickOfComponents ProcessedBundleData {elements = !elements} !shouldChange !tick = ProcessedBundleData { elements = map ( ProcessedBundleElement {id = !id, component = ComponentData {value = !value, ticks = ComponentTicks {added = !added, changed = !changed}}} -> if shouldChange id then ProcessedBundleElement {id, component = ComponentData {value, ticks = ComponentTicks {added, changed = tick}}} else ProcessedBundleElement {id, component = ComponentData {value, ticks = ComponentTicks {added, changed}}} ) elements }

Sets the added tick of certain elements of the bundle to the specified Tick. setAddedTickOfComponents :: ProcessedBundleData -> (ComponentId -> Bool) -> Tick -> ProcessedBundleData setAddedTickOfComponents ProcessedBundleData {elements = !elements} !shouldChange !tick = ProcessedBundleData { elements = map ( ProcessedBundleElement {id = !id, component = ComponentData {value = !value, ticks = ComponentTicks {added = !added, changed = !changed}}} -> if shouldChange id then ProcessedBundleElement {id, component = ComponentData {value, ticks = ComponentTicks {added = tick, changed}}} else ProcessedBundleElement {id, component = ComponentData {value, ticks = ComponentTicks {added, changed}}} ) elements }

isAlive :: forall m w. MonadSystem w m => Entity -> m Bool Source #

newtype GetSystem Source #

Constructors

GetSystem (forall c. Component c => Proxy c -> Entity -> System (Maybe c))