James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 1 | # automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | # namespace: NestedUnion |
| 4 | |
| 5 | class Any(object): |
| 6 | NONE = 0 |
| 7 | Vec3 = 1 |
| 8 | TestSimpleTableWithEnum = 2 |
| 9 | |
| 10 | def AnyCreator(unionType, table): |
| 11 | from flatbuffers.table import Table |
| 12 | if not isinstance(table, Table): |
| 13 | return None |
| 14 | if unionType == Any().Vec3: |
| 15 | import MyGame.Example.NestedUnion.Vec3 |
| 16 | return MyGame.Example.NestedUnion.Vec3.Vec3T.InitFromBuf(table.Bytes, table.Pos) |
| 17 | if unionType == Any().TestSimpleTableWithEnum: |
| 18 | import MyGame.Example.NestedUnion.TestSimpleTableWithEnum |
| 19 | return MyGame.Example.NestedUnion.TestSimpleTableWithEnum.TestSimpleTableWithEnumT.InitFromBuf(table.Bytes, table.Pos) |
| 20 | return None |