Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | # automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | # namespace: Example |
| 4 | |
| 5 | class Any(object): |
| 6 | NONE = 0 |
| 7 | Monster = 1 |
| 8 | TestSimpleTableWithEnum = 2 |
| 9 | MyGame_Example2_Monster = 3 |
| 10 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 11 | def AnyCreator(unionType, table): |
| 12 | from flatbuffers.table import Table |
| 13 | if not isinstance(table, Table): |
| 14 | return None |
| 15 | if unionType == Any().Monster: |
| 16 | import MyGame.Example.Monster |
| 17 | return MyGame.Example.Monster.MonsterT.InitFromBuf(table.Bytes, table.Pos) |
| 18 | if unionType == Any().TestSimpleTableWithEnum: |
| 19 | import MyGame.Example.TestSimpleTableWithEnum |
| 20 | return MyGame.Example.TestSimpleTableWithEnum.TestSimpleTableWithEnumT.InitFromBuf(table.Bytes, table.Pos) |
| 21 | if unionType == Any().MyGame_Example2_Monster: |
| 22 | import MyGame.Example2.Monster |
| 23 | return MyGame.Example2.Monster.MonsterT.InitFromBuf(table.Bytes, table.Pos) |
| 24 | return None |