blob: 202a214b5d1e5ea794d4bf83bb5cf12a60d8f450 [file] [log] [blame]
Austin Schuh2dd86a92022-09-14 21:19:23 -07001// automatically generated by the FlatBuffers compiler, do not modify
2import { FallingTub } from './falling-tub.js';
3import { HandFan } from './hand-fan.js';
4export var Gadget;
5(function (Gadget) {
6 Gadget[Gadget["NONE"] = 0] = "NONE";
7 Gadget[Gadget["FallingTub"] = 1] = "FallingTub";
8 Gadget[Gadget["HandFan"] = 2] = "HandFan";
9})(Gadget || (Gadget = {}));
10export function unionToGadget(type, accessor) {
11 switch (Gadget[type]) {
12 case 'NONE': return null;
13 case 'FallingTub': return accessor(new FallingTub());
14 case 'HandFan': return accessor(new HandFan());
15 default: return null;
16 }
17}
18export function unionListToGadget(type, accessor, index) {
19 switch (Gadget[type]) {
20 case 'NONE': return null;
21 case 'FallingTub': return accessor(index, new FallingTub());
22 case 'HandFan': return accessor(index, new HandFan());
23 default: return null;
24 }
25}