"Fossies" - the Fresh Open Source Software Archive 
Member "flatbuffers-23.1.21/tests/MyGame/Example/Ability.php" (21 Jan 2023, 1059 Bytes) of package /linux/misc/flatbuffers-23.1.21.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 <?php
2 // automatically generated by the FlatBuffers compiler, do not modify
3
4 namespace MyGame\Example;
5
6 use \Google\FlatBuffers\Struct;
7 use \Google\FlatBuffers\Table;
8 use \Google\FlatBuffers\ByteBuffer;
9 use \Google\FlatBuffers\FlatBufferBuilder;
10
11 class Ability extends Struct
12 {
13 /**
14 * @param int $_i offset
15 * @param ByteBuffer $_bb
16 * @return Ability
17 **/
18 public function init($_i, ByteBuffer $_bb)
19 {
20 $this->bb_pos = $_i;
21 $this->bb = $_bb;
22 return $this;
23 }
24
25 /**
26 * @return uint
27 */
28 public function GetId()
29 {
30 return $this->bb->getUint($this->bb_pos + 0);
31 }
32
33 /**
34 * @return uint
35 */
36 public function GetDistance()
37 {
38 return $this->bb->getUint($this->bb_pos + 4);
39 }
40
41
42 /**
43 * @return int offset
44 */
45 public static function createAbility(FlatBufferBuilder $builder, $id, $distance)
46 {
47 $builder->prep(4, 8);
48 $builder->putUint($distance);
49 $builder->putUint($id);
50 return $builder->offset();
51 }
52 }