Lines Matching refs:Weapon
166 union Equipment { Weapon } // Optionally add more tables.
182 weapons:[Weapon]; // Vector of tables.
187 table Weapon {
211 useful, as it only contains the one `table` (named `Weapon`). If we had created
230 The `Weapon` table is a sub-table used within our FlatBuffer. It is
242 the `Weapon` table as:
244 table Weapon {
408 import MyGame.Sample.Weapon
483 local weapon = require("MyGame.Sample.Weapon")
504 Weapon, WeaponArgs};
607 our `orc` Monster, lets create some `Weapon`s: a `Sword` and an `Axe`.
631 int sword = Weapon.createWeapon(builder, weaponOneName, weaponOneDamage);
632 int axe = Weapon.createWeapon(builder, weaponTwoName, weaponTwoDamage);
644 var sword = Weapon.CreateWeapon(builder, weaponOneName, (short)weaponOneDamage);
645 var axe = Weapon.CreateWeapon(builder, weaponTwoName, (short)weaponTwoDamage);
653 // Create the first `Weapon` ("Sword").
655 sample.Weapon.AddName(builder, weaponOne)
656 sample.Weapon.AddDamage(builder, 3)
659 // Create the second `Weapon` ("Axe").
661 sample.Weapon.AddName(builder, weaponTwo)
662 sample.Weapon.AddDamage(builder, 5)
671 # Create the first `Weapon` ('Sword').
672 MyGame.Sample.Weapon.WeaponStart(builder)
673 MyGame.Sample.Weapon.WeaponAddName(builder, weapon_one)
674 MyGame.Sample.Weapon.WeaponAddDamage(builder, 3)
675 sword = MyGame.Sample.Weapon.WeaponEnd(builder)
677 # Create the second `Weapon` ('Axe').
678 MyGame.Sample.Weapon.WeaponStart(builder)
679 MyGame.Sample.Weapon.WeaponAddName(builder, weapon_two)
680 MyGame.Sample.Weapon.WeaponAddDamage(builder, 5)
681 axe = MyGame.Sample.Weapon.WeaponEnd(builder)
689 // Create the first `Weapon` ('Sword').
690 MyGame.Sample.Weapon.startWeapon(builder);
691 MyGame.Sample.Weapon.addName(builder, weaponOne);
692 MyGame.Sample.Weapon.addDamage(builder, 3);
693 var sword = MyGame.Sample.Weapon.endWeapon(builder);
695 // Create the second `Weapon` ('Axe').
696 MyGame.Sample.Weapon.startWeapon(builder);
697 MyGame.Sample.Weapon.addName(builder, weaponTwo);
698 MyGame.Sample.Weapon.addDamage(builder, 5);
699 var axe = MyGame.Sample.Weapon.endWeapon(builder);
707 // Create the first `Weapon` ('Sword').
708 MyGame.Sample.Weapon.startWeapon(builder);
709 MyGame.Sample.Weapon.addName(builder, weaponOne);
710 MyGame.Sample.Weapon.addDamage(builder, 3);
711 let sword = MyGame.Sample.Weapon.endWeapon(builder);
713 // Create the second `Weapon` ('Axe').
714 MyGame.Sample.Weapon.startWeapon(builder);
715 MyGame.Sample.Weapon.addName(builder, weaponTwo);
716 MyGame.Sample.Weapon.addDamage(builder, 5);
717 let axe = MyGame.Sample.Weapon.endWeapon(builder);
722 // Create the `Weapon`s using the `createWeapon()` helper function.
724 $sword = \MyGame\Sample\Weapon::CreateWeapon($builder, $weapon_one_name, 3);
727 $axe = \MyGame\Sample\Weapon::CreateWeapon($builder, $weapon_two_name, 5);
729 // Create an array from the two `Weapon`s and pass it to the
797 -- Create the first 'Weapon'
803 -- Create the second 'Weapon'
829 // Use the `Weapon::create` shortcut to create Weapons with named field
831 let sword = Weapon::create(&mut builder, &WeaponArgs{
835 let axe = Weapon::create(&mut builder, &WeaponArgs{
1035 For example, take a look at the two `Weapon`s that we created earlier (`Sword`
1043 std::vector<flatbuffers::Offset<Weapon>> weapons_vector;
1063 var weaps = new Offset<Weapon>[2];
1093 // Create an array from the two `Weapon`s and pass it to the
1101 // Create an array from the two `Weapon`s and pass it to the
1109 // Create an array from the two `Weapon`s and pass it to the
1129 // If using the ObjectBuilders, just create an array from the two `Weapon`s
1313 Monster.addEquippedType(builder, Equipment.Weapon);
1329 Monster.AddEquippedType(builder, Equipment.Weapon);
1364 builder, MyGame.Sample.Equipment.Equipment().Weapon)
1381 MyGame.Sample.Monster.addEquippedType(builder, MyGame.Sample.Equipment.Weapon);
1398 MyGame.Sample.Monster.addEquippedType(builder, MyGame.Sample.Equipment.Weapon);
1415 \MyGame\Sample\Monster::AddEquippedType($builder, \MyGame\Sample\Equipment::Weapon);
1447 ..addEquippedType(myGame.EquipmentTypeId.Weapon)
1472 equippedType: myGame.EquipmentTypeId.Weapon,
1497 monster.AddEquippedType(builder, equipment.Weapon)
1532 equipped_type: Equipment::Weapon,
1623 Monster.addEquippedType(builder, Equipment.Weapon); // Union type
1629 Monster.AddEquippedType(builder, Equipment.Weapon); // Union type
1642 builder, MyGame.Sample.Equipment.Equipment().Weapon)
1648 MyGame.Sample.Monster.addEquippedType(builder, MyGame.Sample.Equipment.Weapon); // Union type
1654 MyGame.Sample.Monster.addEquippedType(builder, MyGame.Sample.Equipment.Weapon); // Union type
1660 … \MyGame\Sample\Monster::AddEquippedType($builder, \MyGame\Sample\Equipment::Weapon); // Union type
1673 ..addEquippedType(myGame.EquipmentTypeId.Weapon)
1677 equippedTypeId: myGame.EquipmentTypeId.Weapon, // Union type
1683 monster.AddEquippedType(builder, equipment.Weapon) -- Union type
1697 monster_builder.add_equipped_type(Equipment::Weapon); // Union type
2030 local weapon = require("MyGame.Sample.Weapon")
2051 Weapon, WeaponArgs};
2529 weapon := new(sample.Weapon) // We need a `sample.Weapon` to pass into `monster.Weapons()`
2584 local secondWeaponName = mon:Weapon(2):Name()
2585 local secondWeaponDamage = mon:Weapon(2):Damage()
2618 auto weapon = static_cast<const Weapon*>(monster->equipped()); // Requires `static_cast`
2619 // to type `const Weapon*`.
2630 if (unionType == Equipment.Weapon) {
2631 Weapon weapon = (Weapon)monster.equipped(new Weapon()); // Requires explicit cast
2632 // to `Weapon`.
2643 if (unionType == Equipment.Weapon) {
2644 var weapon = monster.Equipped<Weapon>().Value;
2661 // Create a `sample.Weapon` object that can be initialized with the contents
2664 unionWeapon = new(sample.Weapon)
2677 if union_type == MyGame.Sample.Equipment.Equipment().Weapon:
2679 # initialize a `MyGame.Sample.Weapon.Weapon()`.
2680 union_weapon = MyGame.Sample.Weapon.Weapon()
2691 if (unionType == MyGame.Sample.Equipment.Weapon) {
2692 var weapon_name = monster.equipped(new MyGame.Sample.Weapon()).name(); // 'Axe'
2693 var weapon_damage = monster.equipped(new MyGame.Sample.Weapon()).damage(); // 5
2701 if (unionType == MyGame.Sample.Equipment.Weapon) {
2702 let weapon_name = monster.equipped(new MyGame.Sample.Weapon()).name(); // 'Axe'
2703 let weapon_damage = monster.equipped(new MyGame.Sample.Weapon()).damage(); // 5
2711 if ($union_type == \MyGame\Sample\Equipment::Weapon) {
2712 $weapon_name = $monster->getEquipped(new \MyGame\Sample\Weapon())->getName(); // "Axe"
2713 $weapon_damage = $monster->getEquipped(new \MyGame\Sample\Weapon())->getDamage(); // 5
2733 if (unionType == myGame.EquipmentTypeId.Weapon.value) {
2734 myGame.Weapon weapon = mon.equipped as myGame.Weapon;
2745 if unionType == equipment.Weapon then
2773 if monster.equipped_type() == Equipment::Weapon {