def component_modify_checked

bendvy-ecs-core@0.1.0.3 · execution_access.bend:63

import bendvy-ecs-core@0.1.0.3/execution_access.bend as ExecutionAccess
import Base
import bendvy-ecs-core@0.1.0.3/execution_query_identity.bend as Index
import bendvy-ecs-core@0.1.0.3/execution_state.bend as State
import bendvy-ecs-core@0.1.0.3/world.bend as W
import bendvy-ecs-core@0.1.0.3/chunk_column.bend as Col
import bendvy-ecs-core@0.1.0.3/owner_product.bend as Product

63def component_modify_checked(~S:Data,~C:Type,~R:Type,~P:Type,~Rest:Type,~V:Data,~lens:Product.Lens<C,Col.Column<S,P>,Rest>,transform:P -> P & V,allowed:Bool,scope:State.Scope<S,C,R>,handle:W.Handle<S>) -> State.Scope<S,C,R> & Maybe<&2,V>:
64  match allowed:
65    case False{}:(scope,None{})
66    case True{}:component_modify_physical(~S,~C,~R,~P,~Rest,~V,~lens,transform,scope,Index.physical_index(W.handle_index(~S,handle)))

Uses (11)

Used by (1)