...

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

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

     1#[ MyGame.Example.Vec3
     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 Test as MyGame_Example_Test
    13import flatbuffers
    14
    15type Vec3* = object of FlatObj
    16func x*(self: Vec3): float32 =
    17  return Get[float32](self.tab, self.tab.Pos + 0)
    18func `x=`*(self: var Vec3, n: float32): bool =
    19  return self.tab.Mutate(self.tab.Pos + 0, n)
    20func y*(self: Vec3): float32 =
    21  return Get[float32](self.tab, self.tab.Pos + 4)
    22func `y=`*(self: var Vec3, n: float32): bool =
    23  return self.tab.Mutate(self.tab.Pos + 4, n)
    24func z*(self: Vec3): float32 =
    25  return Get[float32](self.tab, self.tab.Pos + 8)
    26func `z=`*(self: var Vec3, n: float32): bool =
    27  return self.tab.Mutate(self.tab.Pos + 8, n)
    28func test1*(self: Vec3): float64 =
    29  return Get[float64](self.tab, self.tab.Pos + 16)
    30func `test1=`*(self: var Vec3, n: float64): bool =
    31  return self.tab.Mutate(self.tab.Pos + 16, n)
    32func test2*(self: Vec3): MyGame_Example_Color.Color =
    33  return MyGame_Example_Color.Color(Get[uint8](self.tab, self.tab.Pos + 24))
    34func `test2=`*(self: var Vec3, n: MyGame_Example_Color.Color): bool =
    35  return self.tab.Mutate(self.tab.Pos + 24, n)
    36func test3*(self: Vec3): MyGame_Example_Test.Test =
    37  return MyGame_Example_Test.Test(tab: Vtable(Bytes: self.tab.Bytes, Pos: self.tab.Pos + 26))
    38proc Vec3Create*(self: var Builder, x: float32, y: float32, z: float32, test1: float64, test2: MyGame_Example_Color.Color, test3_a: int16, test3_b: int8): uoffset =
    39  self.Prep(8, 32)
    40  self.Pad(2)
    41  self.Prep(2, 4)
    42  self.Pad(1)
    43  self.Prepend(test3_b)
    44  self.Prepend(test3_a)
    45  self.Pad(1)
    46  self.Prepend(test2)
    47  self.Prepend(test1)
    48  self.Pad(4)
    49  self.Prepend(z)
    50  self.Prepend(y)
    51  self.Prepend(x)
    52  return self.Offset()

View as plain text