()
| 112 | |
| 113 | replaceWithSnapshot(snapshot: PlayGraphSnapshot): void { |
| 114 | const replace = () => { |
| 115 | this.data = { |
| 116 | entities: Object.fromEntries(snapshot.entities.map((entity) => [entity.id, PlayEntitySchema.parse(entity)])), |
| 117 | edges: Object.fromEntries(snapshot.edges.map((edge) => [edge.id, PlayEdgeSchema.parse(edge)])), |
| 118 | stateSlots: Object.fromEntries(snapshot.stateSlots.map((slot) => [slot.id, PlayStateSlotSchema.parse(slot)])), |
| 119 | events: Object.fromEntries(snapshot.events.map((event) => [event.id, PlayEventSchema.parse(event)])), |
| 120 | }; |
| 121 | }; |
| 122 | if (this.transactionBackup) { |
| 123 | replace(); |
| 124 | return; |
no outgoing calls