• Home
  • Raw
  • Download

Lines Matching refs:fbb

23   var fbb = new flatbuffers.Builder(1);
24 createMonster(fbb);
25 serializeAndTest(fbb);
29 var startingCapacity = fbb.bb.capacity();
31 fbb.clear();
32 createMonster(fbb);
33 serializeAndTest(fbb);
36 assert.strictEqual(fbb.bb.capacity(), startingCapacity);
45 function createMonster(fbb) { argument
48 var str = fbb.createString('MyMonster');
50 var inv = MyGame.Example.Monster.createInventoryVector(fbb, [0, 1, 2, 3, 4]);
52 var fred = fbb.createString('Fred');
53 MyGame.Example.Monster.startMonster(fbb);
54 MyGame.Example.Monster.addName(fbb, fred);
55 var mon2 = MyGame.Example.Monster.endMonster(fbb);
57 MyGame.Example.Monster.startTest4Vector(fbb, 2);
58 MyGame.Example.Test.createTest(fbb, 10, 20);
59 MyGame.Example.Test.createTest(fbb, 30, 40);
60 var test4 = fbb.endVector();
62 var testArrayOfString = MyGame.Example.Monster.createTestarrayofstringVector(fbb, [
63 fbb.createString('test1'),
64 fbb.createString('test2')
67 MyGame.Example.Monster.startMonster(fbb);
68 …MyGame.Example.Monster.addPos(fbb, MyGame.Example.Vec3.createVec3(fbb, 1, 2, 3, 3, MyGame.Example.…
69 MyGame.Example.Monster.addHp(fbb, 80);
70 MyGame.Example.Monster.addName(fbb, str);
71 MyGame.Example.Monster.addInventory(fbb, inv);
72 MyGame.Example.Monster.addTestType(fbb, MyGame.Example.Any.Monster);
73 MyGame.Example.Monster.addTest(fbb, mon2);
74 MyGame.Example.Monster.addTest4(fbb, test4);
75 MyGame.Example.Monster.addTestarrayofstring(fbb, testArrayOfString);
76 MyGame.Example.Monster.addTestbool(fbb, true);
77 var mon = MyGame.Example.Monster.endMonster(fbb);
79 MyGame.Example.Monster.finishMonsterBuffer(fbb, mon);
82 function serializeAndTest(fbb) { argument
88 fs.writeFileSync('monsterdata_javascript_wire.mon', new Buffer(fbb.asUint8Array()));
92 testMutation(fbb.dataBuffer());
94 testBuffer(fbb.dataBuffer());
164 var fbb = new flatbuffers.Builder();
165 var required = fbb.createString('required');
167 MyGame.Example.Stat.startStat(fbb);
168 var stat2 = MyGame.Example.Stat.endStat(fbb);
170 MyGame.Example.Monster.startMonster(fbb);
171 MyGame.Example.Monster.addName(fbb, required);
172 MyGame.Example.Monster.addTestempty(fbb, stat2);
173 var mon2 = MyGame.Example.Monster.endMonster(fbb);
175 MyGame.Example.Stat.startStat(fbb);
177 …MyGame.Example.Stat.addVal(fbb, new flatbuffers.Long(0x87654321, 0x23456789)); // the low part …
178 var stat = MyGame.Example.Stat.endStat(fbb);
180 MyGame.Example.Monster.startMonster(fbb);
181 MyGame.Example.Monster.addName(fbb, required);
182 MyGame.Example.Monster.addEnemy(fbb, mon2);
183 MyGame.Example.Monster.addTestempty(fbb, stat);
184 var mon = MyGame.Example.Monster.endMonster(fbb);
186 MyGame.Example.Monster.finishMonsterBuffer(fbb, mon);
187 var bytes = fbb.asUint8Array();
233 var fbb = new flatbuffers.Builder();
234 var name = fbb.createString(json.name);
236 var name = fbb.createString(new Uint8Array(new Buffer(table.name)));
237 MyGame.Example.Monster.startMonster(fbb);
238 MyGame.Example.Monster.addName(fbb, name);
239 return MyGame.Example.Monster.endMonster(fbb);
241 var testarrayoftablesOffset = MyGame.Example.Monster.createTestarrayoftablesVector(fbb,
243 var testarrayofstringOffset = MyGame.Example.Monster.createTestarrayofstringVector(fbb,
244 json.testarrayofstring.map(function(string) { return fbb.createString(string); }));
245 MyGame.Example.Monster.startMonster(fbb);
246 MyGame.Example.Monster.addTestarrayofstring(fbb, testarrayofstringOffset);
247 MyGame.Example.Monster.addTestarrayoftables(fbb, testarrayoftablesOffset);
248 MyGame.Example.Monster.addName(fbb, name);
249 MyGame.Example.Monster.finishMonsterBuffer(fbb, MyGame.Example.Monster.endMonster(fbb));
250 testReadingUnicode(new flatbuffers.ByteBuffer(fbb.asUint8Array()));