def category

bendvy-ecs-core@0.1.0.4 · ordinary_check_relation.bend:20

import bendvy-ecs-core@0.1.0.4/ordinary_check_relation.bend as OrdinaryCheckRelation
import Base
import bendvy-ecs-core@0.1.0.4/ordinary_check_declaration.bend as D
import bendvy-ecs-core@0.1.0.4/ordinary_inspector_relation.bend as Decl

20def category(value:D.RelationIdentity,mode:Decl.Mode) -> D.Category:
21  match mode:
22    case Decl.RequiredOut{key}:D.Relation{value,D.Outgoing{},D.RelationRequired{},Some{key}}
23    case Decl.OptionalOut{key}:D.Relation{value,D.Outgoing{},D.RelationOptional{},Some{key}}
24    case Decl.PresentOut{}:D.Relation{value,D.Outgoing{},D.RelationPresent{},None{}}
25    case Decl.AbsentOut{}:D.Relation{value,D.Outgoing{},D.RelationAbsent{},None{}}
26    case Decl.RequiredIn{key}:D.Relation{value,D.Incoming{},D.RelationRequired{},Some{key}}
27    case Decl.OptionalIn{key}:D.Relation{value,D.Incoming{},D.RelationOptional{},Some{key}}
28    case Decl.PresentIn{}:D.Relation{value,D.Incoming{},D.RelationPresent{},None{}}
29    case Decl.AbsentIn{}:D.Relation{value,D.Incoming{},D.RelationAbsent{},None{}}

Uses (6)

Used by (1)