Rust structz (#6539)

* Rust structz

* struct of structs test

* swift tmp variables

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-03-29 19:56:45 -04:00
committed by GitHub
parent 1c26d2a1a0
commit 4133a39df8
25 changed files with 1681 additions and 564 deletions

View File

@@ -54,6 +54,8 @@ class Vec3
class Ability
class StructOfStructs
class Stat
class Referrable
@@ -164,6 +166,28 @@ def CreateAbility(b_:flatbuffers_builder, id:int, distance:int):
b_.PrependUint32(id)
return b_.Offset()
class StructOfStructs : flatbuffers_handle
def a():
return MyGame_Example_Ability{ buf_, pos_ + 0 }
def b():
return MyGame_Example_Test{ buf_, pos_ + 8 }
def c():
return MyGame_Example_Ability{ buf_, pos_ + 12 }
def CreateStructOfStructs(b_:flatbuffers_builder, a_id:int, a_distance:int, b_a:int, b_b:int, c_id:int, c_distance:int):
b_.Prep(4, 20)
b_.Prep(4, 8)
b_.PrependUint32(c_distance)
b_.PrependUint32(c_id)
b_.Prep(2, 4)
b_.Pad(1)
b_.PrependInt8(b_b)
b_.PrependInt16(b_a)
b_.Prep(4, 8)
b_.PrependUint32(a_distance)
b_.PrependUint32(a_id)
return b_.Offset()
class Stat : flatbuffers_handle
def id():
return buf_.flatbuffers_field_string(pos_, 4)