def entity

bendvy-ecs-core@0.1.0.4 · restore_raw.bend:53

import bendvy-ecs-core@0.1.0.4/restore_raw.bend as RestoreRaw
import Base
import bendvy-ecs-core@0.1.0.4/decode_data.bend as D
import bendvy-ecs-core@0.1.0.4/snapshot_data.bend as Snapshot

53def entity(+path:String,raw:D.Raw) -> Decoded<Snapshot.Entity>:
54  match raw:
55    case D.Object{+fields}:entity_key(path,fields,key(path ++ ".id",D.field("id",fields)))
56    case other:invalid(~Snapshot.Entity,path,"object",other)

Uses (9)

Used by (1)