From f8b203c9c4bec53cb9abceef6bc333a02f272b6b Mon Sep 17 00:00:00 2001 From: Richard A Hofer Date: Mon, 14 Dec 2020 15:00:28 -0500 Subject: Add vectorNumElements attribute to Builder for simpler vector creation. (#6328) * Add vectorNumElements attribute to Builder for simpler vector creation. This adds a default to EndVector which should simplify its use. * Update tutorial to reflect new default arg in Python EndVector. * Remove optional argument to Python EndVector. * Add generated files. * Unset Builder.vectorNumElems when not in use. --- docs/source/Tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/source/Tutorial.md b/docs/source/Tutorial.md index 419ea09d..f3f03f55 100644 --- a/docs/source/Tutorial.md +++ b/docs/source/Tutorial.md @@ -1017,7 +1017,7 @@ traversal. This is generally easy to do on any tree structures. MyGame.Sample.Monster.MonsterStartInventoryVector(builder, 10) for i in reversed(range(0, 10)): builder.PrependByte(i) - inv = builder.EndVector(10) + inv = builder.EndVector() ~~~
@@ -1207,7 +1207,7 @@ offsets. MyGame.Sample.Monster.MonsterStartWeaponsVector(builder, 2) builder.PrependUOffsetTRelative(axe) builder.PrependUOffsetTRelative(sword) - weapons = builder.EndVector(2) + weapons = builder.EndVector() ~~~
@@ -1336,7 +1336,7 @@ for the `path` field above: MyGame.Sample.Monster.MonsterStartPathVector(builder, 2) MyGame.Sample.Vec3.CreateVec3(builder, 1.0, 2.0, 3.0) MyGame.Sample.Vec3.CreateVec3(builder, 4.0, 5.0, 6.0) - path = builder.EndVector(2) + path = builder.EndVector() ~~~
-- cgit v1.2.3