James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 1 | #[ MyGame.Example.TestSimpleTableWithEnum |
| 2 | Automatically generated by the FlatBuffers compiler, do not modify. |
| 3 | Or modify. I'm a message, not a cop. |
| 4 | |
| 5 | flatc version: 22.10.26 |
| 6 | |
| 7 | Declared by : |
| 8 | Rooting type : MyGame.Example.Monster () |
| 9 | ]# |
| 10 | |
| 11 | import Color as MyGame_Example_Color |
| 12 | import flatbuffers |
| 13 | |
| 14 | type TestSimpleTableWithEnum* = object of FlatObj |
| 15 | func color*(self: TestSimpleTableWithEnum): MyGame_Example_Color.Color = |
| 16 | let o = self.tab.Offset(4) |
| 17 | if o != 0: |
| 18 | return MyGame_Example_Color.Color(Get[uint8](self.tab, self.tab.Pos + o)) |
| 19 | return type(result)(2) |
| 20 | func `color=`*(self: var TestSimpleTableWithEnum, n: MyGame_Example_Color.Color): bool = |
| 21 | return self.tab.MutateSlot(4, n) |
| 22 | proc TestSimpleTableWithEnumStart*(builder: var Builder) = |
| 23 | builder.StartObject(1) |
| 24 | proc TestSimpleTableWithEnumAddcolor*(builder: var Builder, color: uint8) = |
| 25 | builder.PrependSlot(0, color, default(uint8)) |
| 26 | proc TestSimpleTableWithEnumEnd*(builder: var Builder): uoffset = |
| 27 | return builder.EndObject() |