...

Text file src/github.com/google/flatbuffers/tests/MyGame/Example/TestSimpleTableWithEnum.nim

Documentation: github.com/google/flatbuffers/tests/MyGame/Example

     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: 23.5.26
     6
     7  Declared by  : 
     8  Rooting type : MyGame.Example.Monster ()
     9]#
    10
    11import Color as MyGame_Example_Color
    12import flatbuffers
    13
    14type TestSimpleTableWithEnum* = object of FlatObj
    15func 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)
    20func `color=`*(self: var TestSimpleTableWithEnum, n: MyGame_Example_Color.Color): bool =
    21  return self.tab.MutateSlot(4, n)
    22proc TestSimpleTableWithEnumStart*(builder: var Builder) =
    23  builder.StartObject(1)
    24proc TestSimpleTableWithEnumAddcolor*(builder: var Builder, color: uint8) =
    25  builder.PrependSlot(0, color, default(uint8))
    26proc TestSimpleTableWithEnumEnd*(builder: var Builder): uoffset =
    27  return builder.EndObject()

View as plain text