Home
last modified time | relevance | path

Searched refs:monster (Results 1 – 25 of 57) sorted by relevance

123

/external/flatbuffers/tests/FlatBuffers.Test/
DFlatBuffersExampleTests.cs113 Monster monster = Monster.GetRootAsMonster(fbb.DataBuffer); in CanCreateNewFlatBufferFromScratch()
117 Assert.AreEqual(monster.MutateMana((short)10), false); in CanCreateNewFlatBufferFromScratch()
118 Assert.AreEqual(monster.Mana, (short)150); in CanCreateNewFlatBufferFromScratch()
121 Assert.AreEqual(monster.Testarrayoftables(0).Value.Name, "Barney"); in CanCreateNewFlatBufferFromScratch()
122 Assert.AreEqual(monster.Testarrayoftables(1).Value.Name, "Frodo"); in CanCreateNewFlatBufferFromScratch()
123 Assert.AreEqual(monster.Testarrayoftables(2).Value.Name, "Wilma"); in CanCreateNewFlatBufferFromScratch()
126 Assert.IsTrue(monster.TestarrayoftablesByKey("Frodo") != null); in CanCreateNewFlatBufferFromScratch()
127 Assert.IsTrue(monster.TestarrayoftablesByKey("Barney") != null); in CanCreateNewFlatBufferFromScratch()
128 Assert.IsTrue(monster.TestarrayoftablesByKey("Wilma") != null); in CanCreateNewFlatBufferFromScratch()
131 Assert.AreEqual(monster.TestType, Any.Monster); in CanCreateNewFlatBufferFromScratch()
[all …]
/external/flatbuffers/tests/
DJavaTest.java85 Monster monster = Monster.getRootAsMonster(bb); in TestBuffer() local
87 TestEq(monster.hp(), (short)80); in TestBuffer()
88 TestEq(monster.mana(), (short)150); // default in TestBuffer()
90 TestEq(monster.name(), "MyMonster"); in TestBuffer()
93 Vec3 pos = monster.pos(); in TestBuffer()
103 TestEq(monster.testType(), (byte)Any.Monster); in TestBuffer()
105 TestEq(monster.test(monster2) != null, true); in TestBuffer()
108 TestEq(monster.inventoryLength(), 5); in TestBuffer()
110 for (int i = 0; i < monster.inventoryLength(); i++) in TestBuffer()
111 invsum += monster.inventory(i); in TestBuffer()
[all …]
Dgo_test.go145 for _, monster := range []*example.Monster{monster1, monster2} {
146 if got := monster.Hp(); 80 != got {
151 if got := monster.Mana(); 150 != got {
155 if got := monster.Name(); !bytes.Equal([]byte("MyMonster"), got) {
161 vec = monster.Pos(vec)
167 vec2 := monster.Pos(nil)
215 if got := monster.TestType(); example.AnyMonster != got {
221 if ok := monster.Test(&table2); !ok {
233 inventorySlice := monster.InventoryBytes()
234 if len(inventorySlice) != monster.InventoryLength() {
[all …]
DJavaScriptTest.js81 var monster = MyGame.Example.Monster.getRootAsMonster(bb);
83 monster.mutate_hp(120);
84 assert.strictEqual(monster.hp(), 120);
86 monster.mutate_hp(80);
87 assert.strictEqual(monster.hp(), 80);
89 var manaRes = monster.mutate_mana(10);
98 var monster = MyGame.Example.Monster.getRootAsMonster(bb);
100 assert.strictEqual(monster.hp(), 80);
101 assert.strictEqual(monster.mana(), 150); // default
103 assert.strictEqual(monster.name(), 'MyMonster');
[all …]
DphpTest.php100 $monster = \MyGame\Example\Monster::GetRootAsMonster($bb);
102 $assert->strictEqual($monster->GetHp(), 80);
103 $assert->strictEqual($monster->GetMana(), 150); // default
105 $assert->strictEqual($monster->GetName(), 'MyMonster');
107 $pos = $monster->GetPos();
118 $assert->strictEqual($monster->GetTestType(), \MyGame\Example\Any::Monster);
121 $assert->strictEqual($monster->GetTest($monster2) != null, true);
124 $assert->strictEqual($monster->GetInventoryLength(), 5);
126 for ($i = 0; $i < $monster->GetInventoryLength(); $i++) {
127 $invsum += $monster->GetInventory($i);
[all …]
Dtest.cpp246 auto monster = GetMonster(flatbuf); in AccessFlatBufferTest() local
248 TEST_EQ(monster->hp(), 80); in AccessFlatBufferTest()
249 TEST_EQ(monster->mana(), 150); // default in AccessFlatBufferTest()
250 TEST_EQ_STR(monster->name()->c_str(), "MyMonster"); in AccessFlatBufferTest()
255 auto pos = monster->pos(); in AccessFlatBufferTest()
261 auto inventory = monster->inventory(); in AccessFlatBufferTest()
268 TEST_EQ(monster->color(), Color_Blue); in AccessFlatBufferTest()
271 TEST_EQ(monster->test_type(), Any_Monster); // First make sure which it is. in AccessFlatBufferTest()
272 auto monster2 = reinterpret_cast<const Monster *>(monster->test()); in AccessFlatBufferTest()
277 auto vecofstrings = monster->testarrayofstring(); in AccessFlatBufferTest()
[all …]
Dpy_test.py86 monster = MyGame.Example.Monster.Monster.GetRootAsMonster(buf, offset)
88 asserter(monster.Hp() == 80)
89 asserter(monster.Mana() == 150)
90 asserter(monster.Name() == b'MyMonster')
93 vec = monster.Pos()
114 asserter(monster.TestType() == union_type.Monster)
117 table2 = monster.Test()
127 asserter(monster.InventoryLength() == 5)
130 for i in compat_range(monster.InventoryLength()):
131 v = monster.Inventory(i)
[all …]
/external/flatbuffers/samples/
Dsample_binary.go90 monster := sample.GetRootAsMonster(buf, 0)
94 assert(monster.Mana() == 150, "`monster.Mana()`", strconv.Itoa(int(monster.Mana())), "150")
95 assert(monster.Hp() == 300, "`monster.Hp()`", strconv.Itoa(int(monster.Hp())), "300")
96 assert(string(monster.Name()) == "Orc", "`string(monster.Name())`", string(monster.Name()),
98 assert(monster.Color() == sample.ColorRed, "`monster.Color()`",
99 strconv.Itoa(int(monster.Color())), strconv.Itoa(int(sample.ColorRed)))
105 assert(monster.Pos(nil).X() == 1.0, "`monster.Pos(nil).X()`",
106 strconv.FormatFloat(float64(monster.Pos(nil).X()), 'f', 1, 32), "1.0")
107 assert(monster.Pos(nil).Y() == 2.0, "`monster.Pos(nil).Y()`",
108 strconv.FormatFloat(float64(monster.Pos(nil).Y()), 'f', 1, 32), "2.0")
[all …]
DSampleBinary.cs70 var monster = Monster.GetRootAsMonster(buf); in Main()
76 Assert(monster.Mana == 150, "monster.Mana", Convert.ToString(monster.Mana), in Main()
78 Assert(monster.Hp == 300, "monster.Hp", Convert.ToString(monster.Hp), Convert.ToString(30)); in Main()
79 Assert(monster.Name.Equals("Orc", StringComparison.Ordinal), "monster.Name", monster.Name, in Main()
81 Assert(monster.Color == Color.Red, "monster.Color", Convert.ToString(monster.Color), in Main()
84 var vec = monster.Pos.Value; in Main()
93 for (int i = 0; i < monster.InventoryLength; i++) in Main()
95 Assert(monster.Inventory(i) == i, "monster.Inventory", in Main()
96 Convert.ToString(monster.Inventory(i)), Convert.ToString(i)); in Main()
102 for (int i = 0; i < monster.WeaponsLength; i++) in Main()
[all …]
DSampleBinary.java74 Monster monster = Monster.getRootAsMonster(buf); in main() local
77 assert monster.mana() == (short)150; in main()
78 assert monster.hp() == (short)300; in main()
79 assert monster.name().equals("Orc"); in main()
80 assert monster.color() == Color.Red; in main()
81 assert monster.pos().x() == 1.0f; in main()
82 assert monster.pos().y() == 2.0f; in main()
83 assert monster.pos().z() == 3.0f; in main()
86 for (int i = 0; i < monster.inventoryLength(); i++) { in main()
87 assert monster.inventory(i) == (byte)i; in main()
[all …]
Dsample_binary.py97 monster = MyGame.Sample.Monster.Monster.GetRootAsMonster(buf, 0)
100 assert monster.Mana() == 150
101 assert monster.Hp() == 300
102 assert monster.Name() == 'Orc'
103 assert monster.Color() == MyGame.Sample.Color.Color().Red
104 assert monster.Pos().X() == 1.0
105 assert monster.Pos().Y() == 2.0
106 assert monster.Pos().Z() == 3.0
109 for i in xrange(monster.InventoryLength()):
110 assert monster.Inventory(i) == i
[all …]
DSampleBinary.php78 $monster = \MyGame\Sample\Monster::GetRootAsMonster($buf);
83 $success &= assert($monster->getMana() == 150);
84 $success &= assert($monster->getHp() == 300);
85 $success &= assert($monster->getName() == "Orc");
86 $success &= assert($monster->getColor() == \MyGame\Sample\Color::Red);
87 $success &= assert($monster->getPos()->getX() == 1.0);
88 $success &= assert($monster->getPos()->getY() == 2.0);
89 $success &= assert($monster->getPos()->getZ() == 3.0);
92 for ($i = 0; $i < $monster->getInventoryLength(); $i++) {
93 $success &= assert($monster->getInventory($i) == $i);
[all …]
Dsamplebinary.js74 var monster = MyGame.Sample.Monster.getRootAsMonster(buf);
77 assert.equal(monster.mana(), 150);
78 assert.equal(monster.hp(), 300);
79 assert.equal(monster.name(), 'Orc');
80 assert.equal(monster.color(), MyGame.Sample.Color.Red);
81 assert.equal(monster.pos().x(), 1.0);
82 assert.equal(monster.pos().y(), 2.0);
83 assert.equal(monster.pos().z(), 3.0);
86 for (var i = 0; i < monster.inventoryLength(); i++) {
87 assert.equal(monster.inventory(i), i);
[all …]
Dsample_binary.cpp66 auto monster = GetMonster(builder.GetBufferPointer()); in main() local
69 assert(monster->hp() == 80); in main()
70 assert(monster->mana() == 150); // default in main()
71 assert(monster->name()->str() == "MyMonster"); in main()
74 auto pos = monster->pos(); in main()
80 auto inv = monster->inventory(); in main()
88 auto weps = monster->weapons(); in main()
97 assert(monster->equipped_type() == Equipment_Weapon); in main()
98 auto equipped = static_cast<const Weapon*>(monster->equipped()); in main()
Dphp_sample.sh33 ../flatc --php monster.fbs
35 ../Debug/flatc --php monster.fbs
Dpython_sample.sh33 ../flatc --python monster.fbs
35 ../Debug/flatc --python monster.fbs
Djavascript_sample.sh33 ../flatc --js monster.fbs
35 ../Debug/flatc --js monster.fbs
/external/flatbuffers/docs/source/
DTutorial.md19 through each step necessary to create this monster type using FlatBuffers.
129 [monster.c](https://github.com/dvidelabs/flatcc/blob/master/samples/monster/monster.c)
139 // Example IDL file for our monster's schema.
200 the template to store our `orc` monster. We specify some default values for
257 ./../flatc --cpp samples/monster.fbs
263 ./../flatc --java samples/monster.fbs
269 ./../flatc --csharp samples/monster.fbs
275 ./../flatc --go samples/monster.fbs
281 ./../flatc --python samples/monster.fbs
287 ./../flatc --javascript samples/monster.fbs
[all …]
DGoUsage.md58 buf, err := ioutil.ReadFile("monster.dat")
60 monster := example.GetRootAsMonster(buf, 0)
66 hp := monster.Hp()
67 pos := monster.Pos(nil)
74 monster := example.GetRootAsMonster(buf, 0)
77 if ok := monster.MutateHp(10); !ok {
82 monster.Pos().MutateZ(4)
86 if ok := monster.MutateMana(20); !ok {
DPythonUsage.md55 buf = open('monster.dat', 'rb').read()
57 monster = example.GetRootAsMonster(buf, 0)
63 hp = monster.Hp()
64 pos = monster.Pos()
78 inventory = monster.InventoryAsNumpy()
86 for i in range(monster.InventoryLength()):
87 inventory.append(int(monster.Inventory(i)))
DJavaScriptUsage.md61 var data = new Uint8Array(fs.readFileSync('monster.dat'));
64 var monster = MyGame.Example.Monster.getRootAsMonster(buf);
76 'file_input').files[0]; // "monster.dat" from the HTML <input> field.
83 var monster = MyGame.Example.Monster.getRootAsMonster(buf);
90 // Open the HTML file in a browser and select "monster.dat" from with the
98 var hp = monster.hp();
99 var pos = monster.pos();
DJavaCsharpUsage.md100 Monster monster = Monster.getRootAsMonster(bb);
103 Now you can access the data from the `Monster monster`:
106 short hp = monster.hp();
107 Vec3 pos = monster.pos();
127 var pos = monster.Pos;
131 monster.GetPos(preconstructedPos);
156 `monster.testarrayoftablesByKey("Frodo")` in Java or
157 `monster.TestarrayoftablesByKey("Frodo")` in C#,
/external/curl/tests/data/
Dtest19321 monster
29 monster
77 monster
Dtest108922 monster
31 bigger monster
81 bigger monster
Dtest109023 monster
35 monster
88 bigger monster

123