| 1 |
<?php |
| 2 |
|
| 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 Stat extends Table |
| 12 |
{ |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
public static function getRootAsStat(ByteBuffer $bb) |
| 18 |
{ |
| 19 |
$obj = new Stat(); |
| 20 |
return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb)); |
| 21 |
} |
| 22 |
|
| 23 |
public static function StatIdentifier() |
| 24 |
{ |
| 25 |
return "MONS"; |
| 26 |
} |
| 27 |
|
| 28 |
public static function StatBufferHasIdentifier(ByteBuffer $buf) |
| 29 |
{ |
| 30 |
return self::__has_identifier($buf, self::StatIdentifier()); |
| 31 |
} |
| 32 |
|
| 33 |
public static function StatExtension() |
| 34 |
{ |
| 35 |
return "mon"; |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
public function init($_i, ByteBuffer $_bb) |
| 44 |
{ |
| 45 |
$this->bb_pos = $_i; |
| 46 |
$this->bb = $_bb; |
| 47 |
return $this; |
| 48 |
} |
| 49 |
|
| 50 |
public function getId() |
| 51 |
{ |
| 52 |
$o = $this->__offset(4); |
| 53 |
return $o != 0 ? $this->__string($o + $this->bb_pos) : null; |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
public function getVal() |
| 60 |
{ |
| 61 |
$o = $this->__offset(6); |
| 62 |
return $o != 0 ? $this->bb->getLong($o + $this->bb_pos) : 0; |
| 63 |
} |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
public function getCount() |
| 69 |
{ |
| 70 |
$o = $this->__offset(8); |
| 71 |
return $o != 0 ? $this->bb->getUshort($o + $this->bb_pos) : 0; |
| 72 |
} |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
public static function startStat(FlatBufferBuilder $builder) |
| 79 |
{ |
| 80 |
$builder->StartObject(3); |
| 81 |
} |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
public static function createStat(FlatBufferBuilder $builder, $id, $val, $count) |
| 88 |
{ |
| 89 |
$builder->startObject(3); |
| 90 |
self::addId($builder, $id); |
| 91 |
self::addVal($builder, $val); |
| 92 |
self::addCount($builder, $count); |
| 93 |
$o = $builder->endObject(); |
| 94 |
return $o; |
| 95 |
} |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
public static function addId(FlatBufferBuilder $builder, $id) |
| 103 |
{ |
| 104 |
$builder->addOffsetX(0, $id, 0); |
| 105 |
} |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
public static function addVal(FlatBufferBuilder $builder, $val) |
| 113 |
{ |
| 114 |
$builder->addLongX(1, $val, 0); |
| 115 |
} |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
public static function addCount(FlatBufferBuilder $builder, $count) |
| 123 |
{ |
| 124 |
$builder->addUshortX(2, $count, 0); |
| 125 |
} |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
public static function endStat(FlatBufferBuilder $builder) |
| 132 |
{ |
| 133 |
$o = $builder->endObject(); |
| 134 |
return $o; |
| 135 |
} |
| 136 |
} |