def dispatch_checked

bendvy-ecs-core@0.1.0.4 · ordinary_app_relation_system.bend:37

import bendvy-ecs-core@0.1.0.4/ordinary_app_relation_system.bend as OrdinaryAppRelationSystem
import Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/ordinary_app_relation.bend as Relation
import bendvy-ecs-core@0.1.0.4/relation_failure_reader.bend as Ord
import bendvy-ecs-core@0.1.0.4/relation_commands.bend as A
import bendvy-ecs-core@0.1.0.4/system.bend as Sys

37def dispatch_checked(~S:Data,~C:Type,~R:Type,~E:Data,~declaration:Ord.Declaration<S>,~target:W.Handle<S>,allowed:Bool,owner:Owner(~S,~C,~R,~E,~declaration,~target),world:Relation.World(~S,~C,~R,~E)) -> Owner(~S,~C,~R,~E,~declaration,~target) & Sys.Outcome<Relation.World(~S,~C,~R,~E),Maybe<&2,Unit>,Unit>:
38  match allowed:
39    case False{}:(owner,Sys.Failed{world,None{}})
40    case True{}:dispatched(~S,~C,~R,~E,~declaration,~target,Sys.run(~S,~A.Store<S,C>,~R,~A.Notice<S,E>,~Unit,~Unit,~Unit,~reader(~S,~C,~R,~E,~declaration,~target),owner,world,Unit{}))

Uses (15)

Used by (1)