James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 1 | --[[ MyGame.Example.Monster |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 2 | |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 3 | Automatically generated by the FlatBuffers compiler, do not modify. |
| 4 | Or modify. I'm a message, not a cop. |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 5 | |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 6 | flatc version: 22.10.26 |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 7 | |
| 8 | Declared by : //monster_test.fbs |
| 9 | Rooting type : MyGame.Example.Monster (//monster_test.fbs) |
| 10 | |
| 11 | --]] |
| 12 | |
| 13 | local __MyGame_Example_Ability = require('MyGame.Example.Ability') |
| 14 | local __MyGame_Example_Referrable = require('MyGame.Example.Referrable') |
| 15 | local __MyGame_Example_Stat = require('MyGame.Example.Stat') |
| 16 | local __MyGame_Example_Test = require('MyGame.Example.Test') |
| 17 | local __MyGame_Example_Vec3 = require('MyGame.Example.Vec3') |
| 18 | local __MyGame_InParentNamespace = require('MyGame.InParentNamespace') |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 19 | local flatbuffers = require('flatbuffers') |
| 20 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 21 | -- an example documentation comment: "monster object" |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 22 | local Monster = {} |
| 23 | local mt = {} |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 24 | |
| 25 | function Monster.New() |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 26 | local o = {} |
| 27 | setmetatable(o, {__index = mt}) |
| 28 | return o |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 29 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 30 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 31 | function Monster.GetRootAsMonster(buf, offset) |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 32 | if type(buf) == "string" then |
| 33 | buf = flatbuffers.binaryArray.New(buf) |
| 34 | end |
| 35 | |
| 36 | local n = flatbuffers.N.UOffsetT:Unpack(buf, offset) |
| 37 | local o = Monster.New() |
| 38 | o:Init(buf, n + offset) |
| 39 | return o |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 40 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 41 | |
| 42 | function mt:Init(buf, pos) |
| 43 | self.view = flatbuffers.view.New(buf, pos) |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 44 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 45 | |
| 46 | function mt:Pos() |
| 47 | local o = self.view:Offset(4) |
| 48 | if o ~= 0 then |
| 49 | local x = self.view.pos + o |
| 50 | local obj = __MyGame_Example_Vec3.New() |
| 51 | obj:Init(self.view.bytes, x) |
| 52 | return obj |
| 53 | end |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 54 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 55 | |
| 56 | function mt:Mana() |
| 57 | local o = self.view:Offset(6) |
| 58 | if o ~= 0 then |
| 59 | return self.view:Get(flatbuffers.N.Int16, self.view.pos + o) |
| 60 | end |
| 61 | return 150 |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 62 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 63 | |
| 64 | function mt:Hp() |
| 65 | local o = self.view:Offset(8) |
| 66 | if o ~= 0 then |
| 67 | return self.view:Get(flatbuffers.N.Int16, self.view.pos + o) |
| 68 | end |
| 69 | return 100 |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 70 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 71 | |
| 72 | function mt:Name() |
| 73 | local o = self.view:Offset(10) |
| 74 | if o ~= 0 then |
| 75 | return self.view:String(self.view.pos + o) |
| 76 | end |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 77 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 78 | |
| 79 | function mt:Inventory(j) |
| 80 | local o = self.view:Offset(14) |
| 81 | if o ~= 0 then |
| 82 | local a = self.view:Vector(o) |
| 83 | return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1)) |
| 84 | end |
| 85 | return 0 |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 86 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 87 | |
| 88 | function mt:InventoryAsString(start, stop) |
| 89 | return self.view:VectorAsString(14, start, stop) |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 90 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 91 | |
| 92 | function mt:InventoryLength() |
| 93 | local o = self.view:Offset(14) |
| 94 | if o ~= 0 then |
| 95 | return self.view:VectorLen(o) |
| 96 | end |
| 97 | return 0 |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 98 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 99 | |
| 100 | function mt:Color() |
| 101 | local o = self.view:Offset(16) |
| 102 | if o ~= 0 then |
| 103 | return self.view:Get(flatbuffers.N.Uint8, self.view.pos + o) |
| 104 | end |
| 105 | return 8 |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 106 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 107 | |
| 108 | function mt:TestType() |
| 109 | local o = self.view:Offset(18) |
| 110 | if o ~= 0 then |
| 111 | return self.view:Get(flatbuffers.N.Uint8, self.view.pos + o) |
| 112 | end |
| 113 | return 0 |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 114 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 115 | |
| 116 | function mt:Test() |
| 117 | local o = self.view:Offset(20) |
| 118 | if o ~= 0 then |
| 119 | local obj = flatbuffers.view.New(flatbuffers.binaryArray.New(0), 0) |
| 120 | self.view:Union(obj, o) |
| 121 | return obj |
| 122 | end |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 123 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 124 | |
| 125 | function mt:Test4(j) |
| 126 | local o = self.view:Offset(22) |
| 127 | if o ~= 0 then |
| 128 | local x = self.view:Vector(o) |
| 129 | x = x + ((j-1) * 4) |
| 130 | local obj = __MyGame_Example_Test.New() |
| 131 | obj:Init(self.view.bytes, x) |
| 132 | return obj |
| 133 | end |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 134 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 135 | |
| 136 | function mt:Test4Length() |
| 137 | local o = self.view:Offset(22) |
| 138 | if o ~= 0 then |
| 139 | return self.view:VectorLen(o) |
| 140 | end |
| 141 | return 0 |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 142 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 143 | |
| 144 | function mt:Testarrayofstring(j) |
| 145 | local o = self.view:Offset(24) |
| 146 | if o ~= 0 then |
| 147 | local a = self.view:Vector(o) |
| 148 | return self.view:String(a + ((j-1) * 4)) |
| 149 | end |
| 150 | return '' |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 151 | end |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 152 | |
| 153 | function mt:TestarrayofstringLength() |
| 154 | local o = self.view:Offset(24) |
| 155 | if o ~= 0 then |
| 156 | return self.view:VectorLen(o) |
| 157 | end |
| 158 | return 0 |
| 159 | end |
| 160 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 161 | -- an example documentation comment: this will end up in the generated code |
| 162 | -- multiline too |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 163 | function mt:Testarrayoftables(j) |
| 164 | local o = self.view:Offset(26) |
| 165 | if o ~= 0 then |
| 166 | local x = self.view:Vector(o) |
| 167 | x = x + ((j-1) * 4) |
| 168 | x = self.view:Indirect(x) |
| 169 | local obj = Monster.New() |
| 170 | obj:Init(self.view.bytes, x) |
| 171 | return obj |
| 172 | end |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 173 | end |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 174 | |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 175 | function mt:TestarrayoftablesLength() |
| 176 | local o = self.view:Offset(26) |
| 177 | if o ~= 0 then |
| 178 | return self.view:VectorLen(o) |
| 179 | end |
| 180 | return 0 |
| 181 | end |
| 182 | |
| 183 | function mt:Enemy() |
| 184 | local o = self.view:Offset(28) |
| 185 | if o ~= 0 then |
| 186 | local x = self.view:Indirect(self.view.pos + o) |
| 187 | local obj = Monster.New() |
| 188 | obj:Init(self.view.bytes, x) |
| 189 | return obj |
| 190 | end |
| 191 | end |
| 192 | |
| 193 | function mt:Testnestedflatbuffer(j) |
| 194 | local o = self.view:Offset(30) |
| 195 | if o ~= 0 then |
| 196 | local a = self.view:Vector(o) |
| 197 | return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1)) |
| 198 | end |
| 199 | return 0 |
| 200 | end |
| 201 | |
| 202 | function mt:TestnestedflatbufferAsString(start, stop) |
| 203 | return self.view:VectorAsString(30, start, stop) |
| 204 | end |
| 205 | |
| 206 | function mt:TestnestedflatbufferLength() |
| 207 | local o = self.view:Offset(30) |
| 208 | if o ~= 0 then |
| 209 | return self.view:VectorLen(o) |
| 210 | end |
| 211 | return 0 |
| 212 | end |
| 213 | |
| 214 | function mt:Testempty() |
| 215 | local o = self.view:Offset(32) |
| 216 | if o ~= 0 then |
| 217 | local x = self.view:Indirect(self.view.pos + o) |
| 218 | local obj = __MyGame_Example_Stat.New() |
| 219 | obj:Init(self.view.bytes, x) |
| 220 | return obj |
| 221 | end |
| 222 | end |
| 223 | |
| 224 | function mt:Testbool() |
| 225 | local o = self.view:Offset(34) |
| 226 | if o ~= 0 then |
| 227 | return (self.view:Get(flatbuffers.N.Bool, self.view.pos + o) ~=0) |
| 228 | end |
| 229 | return false |
| 230 | end |
| 231 | |
| 232 | function mt:Testhashs32Fnv1() |
| 233 | local o = self.view:Offset(36) |
| 234 | if o ~= 0 then |
| 235 | return self.view:Get(flatbuffers.N.Int32, self.view.pos + o) |
| 236 | end |
| 237 | return 0 |
| 238 | end |
| 239 | |
| 240 | function mt:Testhashu32Fnv1() |
| 241 | local o = self.view:Offset(38) |
| 242 | if o ~= 0 then |
| 243 | return self.view:Get(flatbuffers.N.Uint32, self.view.pos + o) |
| 244 | end |
| 245 | return 0 |
| 246 | end |
| 247 | |
| 248 | function mt:Testhashs64Fnv1() |
| 249 | local o = self.view:Offset(40) |
| 250 | if o ~= 0 then |
| 251 | return self.view:Get(flatbuffers.N.Int64, self.view.pos + o) |
| 252 | end |
| 253 | return 0 |
| 254 | end |
| 255 | |
| 256 | function mt:Testhashu64Fnv1() |
| 257 | local o = self.view:Offset(42) |
| 258 | if o ~= 0 then |
| 259 | return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o) |
| 260 | end |
| 261 | return 0 |
| 262 | end |
| 263 | |
| 264 | function mt:Testhashs32Fnv1a() |
| 265 | local o = self.view:Offset(44) |
| 266 | if o ~= 0 then |
| 267 | return self.view:Get(flatbuffers.N.Int32, self.view.pos + o) |
| 268 | end |
| 269 | return 0 |
| 270 | end |
| 271 | |
| 272 | function mt:Testhashu32Fnv1a() |
| 273 | local o = self.view:Offset(46) |
| 274 | if o ~= 0 then |
| 275 | return self.view:Get(flatbuffers.N.Uint32, self.view.pos + o) |
| 276 | end |
| 277 | return 0 |
| 278 | end |
| 279 | |
| 280 | function mt:Testhashs64Fnv1a() |
| 281 | local o = self.view:Offset(48) |
| 282 | if o ~= 0 then |
| 283 | return self.view:Get(flatbuffers.N.Int64, self.view.pos + o) |
| 284 | end |
| 285 | return 0 |
| 286 | end |
| 287 | |
| 288 | function mt:Testhashu64Fnv1a() |
| 289 | local o = self.view:Offset(50) |
| 290 | if o ~= 0 then |
| 291 | return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o) |
| 292 | end |
| 293 | return 0 |
| 294 | end |
| 295 | |
| 296 | function mt:Testarrayofbools(j) |
| 297 | local o = self.view:Offset(52) |
| 298 | if o ~= 0 then |
| 299 | local a = self.view:Vector(o) |
| 300 | return self.view:Get(flatbuffers.N.Bool, a + ((j-1) * 1)) |
| 301 | end |
| 302 | return 0 |
| 303 | end |
| 304 | |
| 305 | function mt:TestarrayofboolsAsString(start, stop) |
| 306 | return self.view:VectorAsString(52, start, stop) |
| 307 | end |
| 308 | |
| 309 | function mt:TestarrayofboolsLength() |
| 310 | local o = self.view:Offset(52) |
| 311 | if o ~= 0 then |
| 312 | return self.view:VectorLen(o) |
| 313 | end |
| 314 | return 0 |
| 315 | end |
| 316 | |
| 317 | function mt:Testf() |
| 318 | local o = self.view:Offset(54) |
| 319 | if o ~= 0 then |
| 320 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 321 | end |
| 322 | return 3.14159 |
| 323 | end |
| 324 | |
| 325 | function mt:Testf2() |
| 326 | local o = self.view:Offset(56) |
| 327 | if o ~= 0 then |
| 328 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 329 | end |
| 330 | return 3.0 |
| 331 | end |
| 332 | |
| 333 | function mt:Testf3() |
| 334 | local o = self.view:Offset(58) |
| 335 | if o ~= 0 then |
| 336 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 337 | end |
| 338 | return 0.0 |
| 339 | end |
| 340 | |
| 341 | function mt:Testarrayofstring2(j) |
| 342 | local o = self.view:Offset(60) |
| 343 | if o ~= 0 then |
| 344 | local a = self.view:Vector(o) |
| 345 | return self.view:String(a + ((j-1) * 4)) |
| 346 | end |
| 347 | return '' |
| 348 | end |
| 349 | |
| 350 | function mt:Testarrayofstring2Length() |
| 351 | local o = self.view:Offset(60) |
| 352 | if o ~= 0 then |
| 353 | return self.view:VectorLen(o) |
| 354 | end |
| 355 | return 0 |
| 356 | end |
| 357 | |
| 358 | function mt:Testarrayofsortedstruct(j) |
| 359 | local o = self.view:Offset(62) |
| 360 | if o ~= 0 then |
| 361 | local x = self.view:Vector(o) |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 362 | x = x + ((j-1) * 8) |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 363 | local obj = __MyGame_Example_Ability.New() |
| 364 | obj:Init(self.view.bytes, x) |
| 365 | return obj |
| 366 | end |
| 367 | end |
| 368 | |
| 369 | function mt:TestarrayofsortedstructLength() |
| 370 | local o = self.view:Offset(62) |
| 371 | if o ~= 0 then |
| 372 | return self.view:VectorLen(o) |
| 373 | end |
| 374 | return 0 |
| 375 | end |
| 376 | |
| 377 | function mt:Flex(j) |
| 378 | local o = self.view:Offset(64) |
| 379 | if o ~= 0 then |
| 380 | local a = self.view:Vector(o) |
| 381 | return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1)) |
| 382 | end |
| 383 | return 0 |
| 384 | end |
| 385 | |
| 386 | function mt:FlexAsString(start, stop) |
| 387 | return self.view:VectorAsString(64, start, stop) |
| 388 | end |
| 389 | |
| 390 | function mt:FlexLength() |
| 391 | local o = self.view:Offset(64) |
| 392 | if o ~= 0 then |
| 393 | return self.view:VectorLen(o) |
| 394 | end |
| 395 | return 0 |
| 396 | end |
| 397 | |
| 398 | function mt:Test5(j) |
| 399 | local o = self.view:Offset(66) |
| 400 | if o ~= 0 then |
| 401 | local x = self.view:Vector(o) |
| 402 | x = x + ((j-1) * 4) |
| 403 | local obj = __MyGame_Example_Test.New() |
| 404 | obj:Init(self.view.bytes, x) |
| 405 | return obj |
| 406 | end |
| 407 | end |
| 408 | |
| 409 | function mt:Test5Length() |
| 410 | local o = self.view:Offset(66) |
| 411 | if o ~= 0 then |
| 412 | return self.view:VectorLen(o) |
| 413 | end |
| 414 | return 0 |
| 415 | end |
| 416 | |
| 417 | function mt:VectorOfLongs(j) |
| 418 | local o = self.view:Offset(68) |
| 419 | if o ~= 0 then |
| 420 | local a = self.view:Vector(o) |
| 421 | return self.view:Get(flatbuffers.N.Int64, a + ((j-1) * 8)) |
| 422 | end |
| 423 | return 0 |
| 424 | end |
| 425 | |
| 426 | function mt:VectorOfLongsLength() |
| 427 | local o = self.view:Offset(68) |
| 428 | if o ~= 0 then |
| 429 | return self.view:VectorLen(o) |
| 430 | end |
| 431 | return 0 |
| 432 | end |
| 433 | |
| 434 | function mt:VectorOfDoubles(j) |
| 435 | local o = self.view:Offset(70) |
| 436 | if o ~= 0 then |
| 437 | local a = self.view:Vector(o) |
| 438 | return self.view:Get(flatbuffers.N.Float64, a + ((j-1) * 8)) |
| 439 | end |
| 440 | return 0 |
| 441 | end |
| 442 | |
| 443 | function mt:VectorOfDoublesLength() |
| 444 | local o = self.view:Offset(70) |
| 445 | if o ~= 0 then |
| 446 | return self.view:VectorLen(o) |
| 447 | end |
| 448 | return 0 |
| 449 | end |
| 450 | |
| 451 | function mt:ParentNamespaceTest() |
| 452 | local o = self.view:Offset(72) |
| 453 | if o ~= 0 then |
| 454 | local x = self.view:Indirect(self.view.pos + o) |
| 455 | local obj = __MyGame_InParentNamespace.New() |
| 456 | obj:Init(self.view.bytes, x) |
| 457 | return obj |
| 458 | end |
| 459 | end |
| 460 | |
| 461 | function mt:VectorOfReferrables(j) |
| 462 | local o = self.view:Offset(74) |
| 463 | if o ~= 0 then |
| 464 | local x = self.view:Vector(o) |
| 465 | x = x + ((j-1) * 4) |
| 466 | x = self.view:Indirect(x) |
| 467 | local obj = __MyGame_Example_Referrable.New() |
| 468 | obj:Init(self.view.bytes, x) |
| 469 | return obj |
| 470 | end |
| 471 | end |
| 472 | |
| 473 | function mt:VectorOfReferrablesLength() |
| 474 | local o = self.view:Offset(74) |
| 475 | if o ~= 0 then |
| 476 | return self.view:VectorLen(o) |
| 477 | end |
| 478 | return 0 |
| 479 | end |
| 480 | |
| 481 | function mt:SingleWeakReference() |
| 482 | local o = self.view:Offset(76) |
| 483 | if o ~= 0 then |
| 484 | return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o) |
| 485 | end |
| 486 | return 0 |
| 487 | end |
| 488 | |
| 489 | function mt:VectorOfWeakReferences(j) |
| 490 | local o = self.view:Offset(78) |
| 491 | if o ~= 0 then |
| 492 | local a = self.view:Vector(o) |
| 493 | return self.view:Get(flatbuffers.N.Uint64, a + ((j-1) * 8)) |
| 494 | end |
| 495 | return 0 |
| 496 | end |
| 497 | |
| 498 | function mt:VectorOfWeakReferencesLength() |
| 499 | local o = self.view:Offset(78) |
| 500 | if o ~= 0 then |
| 501 | return self.view:VectorLen(o) |
| 502 | end |
| 503 | return 0 |
| 504 | end |
| 505 | |
| 506 | function mt:VectorOfStrongReferrables(j) |
| 507 | local o = self.view:Offset(80) |
| 508 | if o ~= 0 then |
| 509 | local x = self.view:Vector(o) |
| 510 | x = x + ((j-1) * 4) |
| 511 | x = self.view:Indirect(x) |
| 512 | local obj = __MyGame_Example_Referrable.New() |
| 513 | obj:Init(self.view.bytes, x) |
| 514 | return obj |
| 515 | end |
| 516 | end |
| 517 | |
| 518 | function mt:VectorOfStrongReferrablesLength() |
| 519 | local o = self.view:Offset(80) |
| 520 | if o ~= 0 then |
| 521 | return self.view:VectorLen(o) |
| 522 | end |
| 523 | return 0 |
| 524 | end |
| 525 | |
| 526 | function mt:CoOwningReference() |
| 527 | local o = self.view:Offset(82) |
| 528 | if o ~= 0 then |
| 529 | return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o) |
| 530 | end |
| 531 | return 0 |
| 532 | end |
| 533 | |
| 534 | function mt:VectorOfCoOwningReferences(j) |
| 535 | local o = self.view:Offset(84) |
| 536 | if o ~= 0 then |
| 537 | local a = self.view:Vector(o) |
| 538 | return self.view:Get(flatbuffers.N.Uint64, a + ((j-1) * 8)) |
| 539 | end |
| 540 | return 0 |
| 541 | end |
| 542 | |
| 543 | function mt:VectorOfCoOwningReferencesLength() |
| 544 | local o = self.view:Offset(84) |
| 545 | if o ~= 0 then |
| 546 | return self.view:VectorLen(o) |
| 547 | end |
| 548 | return 0 |
| 549 | end |
| 550 | |
| 551 | function mt:NonOwningReference() |
| 552 | local o = self.view:Offset(86) |
| 553 | if o ~= 0 then |
| 554 | return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o) |
| 555 | end |
| 556 | return 0 |
| 557 | end |
| 558 | |
| 559 | function mt:VectorOfNonOwningReferences(j) |
| 560 | local o = self.view:Offset(88) |
| 561 | if o ~= 0 then |
| 562 | local a = self.view:Vector(o) |
| 563 | return self.view:Get(flatbuffers.N.Uint64, a + ((j-1) * 8)) |
| 564 | end |
| 565 | return 0 |
| 566 | end |
| 567 | |
| 568 | function mt:VectorOfNonOwningReferencesLength() |
| 569 | local o = self.view:Offset(88) |
| 570 | if o ~= 0 then |
| 571 | return self.view:VectorLen(o) |
| 572 | end |
| 573 | return 0 |
| 574 | end |
| 575 | |
| 576 | function mt:AnyUniqueType() |
| 577 | local o = self.view:Offset(90) |
| 578 | if o ~= 0 then |
| 579 | return self.view:Get(flatbuffers.N.Uint8, self.view.pos + o) |
| 580 | end |
| 581 | return 0 |
| 582 | end |
| 583 | |
| 584 | function mt:AnyUnique() |
| 585 | local o = self.view:Offset(92) |
| 586 | if o ~= 0 then |
| 587 | local obj = flatbuffers.view.New(flatbuffers.binaryArray.New(0), 0) |
| 588 | self.view:Union(obj, o) |
| 589 | return obj |
| 590 | end |
| 591 | end |
| 592 | |
| 593 | function mt:AnyAmbiguousType() |
| 594 | local o = self.view:Offset(94) |
| 595 | if o ~= 0 then |
| 596 | return self.view:Get(flatbuffers.N.Uint8, self.view.pos + o) |
| 597 | end |
| 598 | return 0 |
| 599 | end |
| 600 | |
| 601 | function mt:AnyAmbiguous() |
| 602 | local o = self.view:Offset(96) |
| 603 | if o ~= 0 then |
| 604 | local obj = flatbuffers.view.New(flatbuffers.binaryArray.New(0), 0) |
| 605 | self.view:Union(obj, o) |
| 606 | return obj |
| 607 | end |
| 608 | end |
| 609 | |
| 610 | function mt:VectorOfEnums(j) |
| 611 | local o = self.view:Offset(98) |
| 612 | if o ~= 0 then |
| 613 | local a = self.view:Vector(o) |
| 614 | return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1)) |
| 615 | end |
| 616 | return 0 |
| 617 | end |
| 618 | |
| 619 | function mt:VectorOfEnumsAsString(start, stop) |
| 620 | return self.view:VectorAsString(98, start, stop) |
| 621 | end |
| 622 | |
| 623 | function mt:VectorOfEnumsLength() |
| 624 | local o = self.view:Offset(98) |
| 625 | if o ~= 0 then |
| 626 | return self.view:VectorLen(o) |
| 627 | end |
| 628 | return 0 |
| 629 | end |
| 630 | |
| 631 | function mt:SignedEnum() |
| 632 | local o = self.view:Offset(100) |
| 633 | if o ~= 0 then |
| 634 | return self.view:Get(flatbuffers.N.Int8, self.view.pos + o) |
| 635 | end |
| 636 | return -1 |
| 637 | end |
| 638 | |
| 639 | function mt:Testrequirednestedflatbuffer(j) |
| 640 | local o = self.view:Offset(102) |
| 641 | if o ~= 0 then |
| 642 | local a = self.view:Vector(o) |
| 643 | return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1)) |
| 644 | end |
| 645 | return 0 |
| 646 | end |
| 647 | |
| 648 | function mt:TestrequirednestedflatbufferAsString(start, stop) |
| 649 | return self.view:VectorAsString(102, start, stop) |
| 650 | end |
| 651 | |
| 652 | function mt:TestrequirednestedflatbufferLength() |
| 653 | local o = self.view:Offset(102) |
| 654 | if o ~= 0 then |
| 655 | return self.view:VectorLen(o) |
| 656 | end |
| 657 | return 0 |
| 658 | end |
| 659 | |
| 660 | function mt:ScalarKeySortedTables(j) |
| 661 | local o = self.view:Offset(104) |
| 662 | if o ~= 0 then |
| 663 | local x = self.view:Vector(o) |
| 664 | x = x + ((j-1) * 4) |
| 665 | x = self.view:Indirect(x) |
| 666 | local obj = __MyGame_Example_Stat.New() |
| 667 | obj:Init(self.view.bytes, x) |
| 668 | return obj |
| 669 | end |
| 670 | end |
| 671 | |
| 672 | function mt:ScalarKeySortedTablesLength() |
| 673 | local o = self.view:Offset(104) |
| 674 | if o ~= 0 then |
| 675 | return self.view:VectorLen(o) |
| 676 | end |
| 677 | return 0 |
| 678 | end |
| 679 | |
| 680 | function mt:NativeInline() |
| 681 | local o = self.view:Offset(106) |
| 682 | if o ~= 0 then |
| 683 | local x = self.view.pos + o |
| 684 | local obj = __MyGame_Example_Test.New() |
| 685 | obj:Init(self.view.bytes, x) |
| 686 | return obj |
| 687 | end |
| 688 | end |
| 689 | |
| 690 | function mt:LongEnumNonEnumDefault() |
| 691 | local o = self.view:Offset(108) |
| 692 | if o ~= 0 then |
| 693 | return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o) |
| 694 | end |
| 695 | return 0 |
| 696 | end |
| 697 | |
| 698 | function mt:LongEnumNormalDefault() |
| 699 | local o = self.view:Offset(110) |
| 700 | if o ~= 0 then |
| 701 | return self.view:Get(flatbuffers.N.Uint64, self.view.pos + o) |
| 702 | end |
| 703 | return 2 |
| 704 | end |
| 705 | |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 706 | function mt:NanDefault() |
| 707 | local o = self.view:Offset(112) |
| 708 | if o ~= 0 then |
| 709 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 710 | end |
| 711 | return nan |
| 712 | end |
| 713 | |
| 714 | function mt:InfDefault() |
| 715 | local o = self.view:Offset(114) |
| 716 | if o ~= 0 then |
| 717 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 718 | end |
| 719 | return inf |
| 720 | end |
| 721 | |
| 722 | function mt:PositiveInfDefault() |
| 723 | local o = self.view:Offset(116) |
| 724 | if o ~= 0 then |
| 725 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 726 | end |
| 727 | return inf |
| 728 | end |
| 729 | |
| 730 | function mt:InfinityDefault() |
| 731 | local o = self.view:Offset(118) |
| 732 | if o ~= 0 then |
| 733 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 734 | end |
| 735 | return inf |
| 736 | end |
| 737 | |
| 738 | function mt:PositiveInfinityDefault() |
| 739 | local o = self.view:Offset(120) |
| 740 | if o ~= 0 then |
| 741 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 742 | end |
| 743 | return inf |
| 744 | end |
| 745 | |
| 746 | function mt:NegativeInfDefault() |
| 747 | local o = self.view:Offset(122) |
| 748 | if o ~= 0 then |
| 749 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 750 | end |
| 751 | return -inf |
| 752 | end |
| 753 | |
| 754 | function mt:NegativeInfinityDefault() |
| 755 | local o = self.view:Offset(124) |
| 756 | if o ~= 0 then |
| 757 | return self.view:Get(flatbuffers.N.Float32, self.view.pos + o) |
| 758 | end |
| 759 | return -inf |
| 760 | end |
| 761 | |
| 762 | function mt:DoubleInfDefault() |
| 763 | local o = self.view:Offset(126) |
| 764 | if o ~= 0 then |
| 765 | return self.view:Get(flatbuffers.N.Float64, self.view.pos + o) |
| 766 | end |
| 767 | return inf |
| 768 | end |
| 769 | |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 770 | function Monster.Start(builder) |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 771 | builder:StartObject(62) |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 772 | end |
| 773 | |
| 774 | function Monster.AddPos(builder, pos) |
| 775 | builder:PrependStructSlot(0, pos, 0) |
| 776 | end |
| 777 | |
| 778 | function Monster.AddMana(builder, mana) |
| 779 | builder:PrependInt16Slot(1, mana, 150) |
| 780 | end |
| 781 | |
| 782 | function Monster.AddHp(builder, hp) |
| 783 | builder:PrependInt16Slot(2, hp, 100) |
| 784 | end |
| 785 | |
| 786 | function Monster.AddName(builder, name) |
| 787 | builder:PrependUOffsetTRelativeSlot(3, name, 0) |
| 788 | end |
| 789 | |
| 790 | function Monster.AddInventory(builder, inventory) |
| 791 | builder:PrependUOffsetTRelativeSlot(5, inventory, 0) |
| 792 | end |
| 793 | |
| 794 | function Monster.StartInventoryVector(builder, numElems) |
| 795 | return builder:StartVector(1, numElems, 1) |
| 796 | end |
| 797 | |
| 798 | function Monster.AddColor(builder, color) |
| 799 | builder:PrependUint8Slot(6, color, 8) |
| 800 | end |
| 801 | |
| 802 | function Monster.AddTestType(builder, testType) |
| 803 | builder:PrependUint8Slot(7, testType, 0) |
| 804 | end |
| 805 | |
| 806 | function Monster.AddTest(builder, test) |
| 807 | builder:PrependUOffsetTRelativeSlot(8, test, 0) |
| 808 | end |
| 809 | |
| 810 | function Monster.AddTest4(builder, test4) |
| 811 | builder:PrependUOffsetTRelativeSlot(9, test4, 0) |
| 812 | end |
| 813 | |
| 814 | function Monster.StartTest4Vector(builder, numElems) |
| 815 | return builder:StartVector(4, numElems, 2) |
| 816 | end |
| 817 | |
| 818 | function Monster.AddTestarrayofstring(builder, testarrayofstring) |
| 819 | builder:PrependUOffsetTRelativeSlot(10, testarrayofstring, 0) |
| 820 | end |
| 821 | |
| 822 | function Monster.StartTestarrayofstringVector(builder, numElems) |
| 823 | return builder:StartVector(4, numElems, 4) |
| 824 | end |
| 825 | |
| 826 | function Monster.AddTestarrayoftables(builder, testarrayoftables) |
| 827 | builder:PrependUOffsetTRelativeSlot(11, testarrayoftables, 0) |
| 828 | end |
| 829 | |
| 830 | function Monster.StartTestarrayoftablesVector(builder, numElems) |
| 831 | return builder:StartVector(4, numElems, 4) |
| 832 | end |
| 833 | |
| 834 | function Monster.AddEnemy(builder, enemy) |
| 835 | builder:PrependStructSlot(12, enemy, 0) |
| 836 | end |
| 837 | |
| 838 | function Monster.AddTestnestedflatbuffer(builder, testnestedflatbuffer) |
| 839 | builder:PrependUOffsetTRelativeSlot(13, testnestedflatbuffer, 0) |
| 840 | end |
| 841 | |
| 842 | function Monster.StartTestnestedflatbufferVector(builder, numElems) |
| 843 | return builder:StartVector(1, numElems, 1) |
| 844 | end |
| 845 | |
| 846 | function Monster.AddTestempty(builder, testempty) |
| 847 | builder:PrependStructSlot(14, testempty, 0) |
| 848 | end |
| 849 | |
| 850 | function Monster.AddTestbool(builder, testbool) |
| 851 | builder:PrependBoolSlot(15, testbool, false) |
| 852 | end |
| 853 | |
| 854 | function Monster.AddTesthashs32Fnv1(builder, testhashs32Fnv1) |
| 855 | builder:PrependInt32Slot(16, testhashs32Fnv1, 0) |
| 856 | end |
| 857 | |
| 858 | function Monster.AddTesthashu32Fnv1(builder, testhashu32Fnv1) |
| 859 | builder:PrependUint32Slot(17, testhashu32Fnv1, 0) |
| 860 | end |
| 861 | |
| 862 | function Monster.AddTesthashs64Fnv1(builder, testhashs64Fnv1) |
| 863 | builder:PrependInt64Slot(18, testhashs64Fnv1, 0) |
| 864 | end |
| 865 | |
| 866 | function Monster.AddTesthashu64Fnv1(builder, testhashu64Fnv1) |
| 867 | builder:PrependUint64Slot(19, testhashu64Fnv1, 0) |
| 868 | end |
| 869 | |
| 870 | function Monster.AddTesthashs32Fnv1a(builder, testhashs32Fnv1a) |
| 871 | builder:PrependInt32Slot(20, testhashs32Fnv1a, 0) |
| 872 | end |
| 873 | |
| 874 | function Monster.AddTesthashu32Fnv1a(builder, testhashu32Fnv1a) |
| 875 | builder:PrependUint32Slot(21, testhashu32Fnv1a, 0) |
| 876 | end |
| 877 | |
| 878 | function Monster.AddTesthashs64Fnv1a(builder, testhashs64Fnv1a) |
| 879 | builder:PrependInt64Slot(22, testhashs64Fnv1a, 0) |
| 880 | end |
| 881 | |
| 882 | function Monster.AddTesthashu64Fnv1a(builder, testhashu64Fnv1a) |
| 883 | builder:PrependUint64Slot(23, testhashu64Fnv1a, 0) |
| 884 | end |
| 885 | |
| 886 | function Monster.AddTestarrayofbools(builder, testarrayofbools) |
| 887 | builder:PrependUOffsetTRelativeSlot(24, testarrayofbools, 0) |
| 888 | end |
| 889 | |
| 890 | function Monster.StartTestarrayofboolsVector(builder, numElems) |
| 891 | return builder:StartVector(1, numElems, 1) |
| 892 | end |
| 893 | |
| 894 | function Monster.AddTestf(builder, testf) |
| 895 | builder:PrependFloat32Slot(25, testf, 3.14159) |
| 896 | end |
| 897 | |
| 898 | function Monster.AddTestf2(builder, testf2) |
| 899 | builder:PrependFloat32Slot(26, testf2, 3.0) |
| 900 | end |
| 901 | |
| 902 | function Monster.AddTestf3(builder, testf3) |
| 903 | builder:PrependFloat32Slot(27, testf3, 0.0) |
| 904 | end |
| 905 | |
| 906 | function Monster.AddTestarrayofstring2(builder, testarrayofstring2) |
| 907 | builder:PrependUOffsetTRelativeSlot(28, testarrayofstring2, 0) |
| 908 | end |
| 909 | |
| 910 | function Monster.StartTestarrayofstring2Vector(builder, numElems) |
| 911 | return builder:StartVector(4, numElems, 4) |
| 912 | end |
| 913 | |
| 914 | function Monster.AddTestarrayofsortedstruct(builder, testarrayofsortedstruct) |
| 915 | builder:PrependUOffsetTRelativeSlot(29, testarrayofsortedstruct, 0) |
| 916 | end |
| 917 | |
| 918 | function Monster.StartTestarrayofsortedstructVector(builder, numElems) |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 919 | return builder:StartVector(8, numElems, 4) |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 920 | end |
| 921 | |
| 922 | function Monster.AddFlex(builder, flex) |
| 923 | builder:PrependUOffsetTRelativeSlot(30, flex, 0) |
| 924 | end |
| 925 | |
| 926 | function Monster.StartFlexVector(builder, numElems) |
| 927 | return builder:StartVector(1, numElems, 1) |
| 928 | end |
| 929 | |
| 930 | function Monster.AddTest5(builder, test5) |
| 931 | builder:PrependUOffsetTRelativeSlot(31, test5, 0) |
| 932 | end |
| 933 | |
| 934 | function Monster.StartTest5Vector(builder, numElems) |
| 935 | return builder:StartVector(4, numElems, 2) |
| 936 | end |
| 937 | |
| 938 | function Monster.AddVectorOfLongs(builder, vectorOfLongs) |
| 939 | builder:PrependUOffsetTRelativeSlot(32, vectorOfLongs, 0) |
| 940 | end |
| 941 | |
| 942 | function Monster.StartVectorOfLongsVector(builder, numElems) |
| 943 | return builder:StartVector(8, numElems, 8) |
| 944 | end |
| 945 | |
| 946 | function Monster.AddVectorOfDoubles(builder, vectorOfDoubles) |
| 947 | builder:PrependUOffsetTRelativeSlot(33, vectorOfDoubles, 0) |
| 948 | end |
| 949 | |
| 950 | function Monster.StartVectorOfDoublesVector(builder, numElems) |
| 951 | return builder:StartVector(8, numElems, 8) |
| 952 | end |
| 953 | |
| 954 | function Monster.AddParentNamespaceTest(builder, parentNamespaceTest) |
| 955 | builder:PrependStructSlot(34, parentNamespaceTest, 0) |
| 956 | end |
| 957 | |
| 958 | function Monster.AddVectorOfReferrables(builder, vectorOfReferrables) |
| 959 | builder:PrependUOffsetTRelativeSlot(35, vectorOfReferrables, 0) |
| 960 | end |
| 961 | |
| 962 | function Monster.StartVectorOfReferrablesVector(builder, numElems) |
| 963 | return builder:StartVector(4, numElems, 4) |
| 964 | end |
| 965 | |
| 966 | function Monster.AddSingleWeakReference(builder, singleWeakReference) |
| 967 | builder:PrependUint64Slot(36, singleWeakReference, 0) |
| 968 | end |
| 969 | |
| 970 | function Monster.AddVectorOfWeakReferences(builder, vectorOfWeakReferences) |
| 971 | builder:PrependUOffsetTRelativeSlot(37, vectorOfWeakReferences, 0) |
| 972 | end |
| 973 | |
| 974 | function Monster.StartVectorOfWeakReferencesVector(builder, numElems) |
| 975 | return builder:StartVector(8, numElems, 8) |
| 976 | end |
| 977 | |
| 978 | function Monster.AddVectorOfStrongReferrables(builder, vectorOfStrongReferrables) |
| 979 | builder:PrependUOffsetTRelativeSlot(38, vectorOfStrongReferrables, 0) |
| 980 | end |
| 981 | |
| 982 | function Monster.StartVectorOfStrongReferrablesVector(builder, numElems) |
| 983 | return builder:StartVector(4, numElems, 4) |
| 984 | end |
| 985 | |
| 986 | function Monster.AddCoOwningReference(builder, coOwningReference) |
| 987 | builder:PrependUint64Slot(39, coOwningReference, 0) |
| 988 | end |
| 989 | |
| 990 | function Monster.AddVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences) |
| 991 | builder:PrependUOffsetTRelativeSlot(40, vectorOfCoOwningReferences, 0) |
| 992 | end |
| 993 | |
| 994 | function Monster.StartVectorOfCoOwningReferencesVector(builder, numElems) |
| 995 | return builder:StartVector(8, numElems, 8) |
| 996 | end |
| 997 | |
| 998 | function Monster.AddNonOwningReference(builder, nonOwningReference) |
| 999 | builder:PrependUint64Slot(41, nonOwningReference, 0) |
| 1000 | end |
| 1001 | |
| 1002 | function Monster.AddVectorOfNonOwningReferences(builder, vectorOfNonOwningReferences) |
| 1003 | builder:PrependUOffsetTRelativeSlot(42, vectorOfNonOwningReferences, 0) |
| 1004 | end |
| 1005 | |
| 1006 | function Monster.StartVectorOfNonOwningReferencesVector(builder, numElems) |
| 1007 | return builder:StartVector(8, numElems, 8) |
| 1008 | end |
| 1009 | |
| 1010 | function Monster.AddAnyUniqueType(builder, anyUniqueType) |
| 1011 | builder:PrependUint8Slot(43, anyUniqueType, 0) |
| 1012 | end |
| 1013 | |
| 1014 | function Monster.AddAnyUnique(builder, anyUnique) |
| 1015 | builder:PrependUOffsetTRelativeSlot(44, anyUnique, 0) |
| 1016 | end |
| 1017 | |
| 1018 | function Monster.AddAnyAmbiguousType(builder, anyAmbiguousType) |
| 1019 | builder:PrependUint8Slot(45, anyAmbiguousType, 0) |
| 1020 | end |
| 1021 | |
| 1022 | function Monster.AddAnyAmbiguous(builder, anyAmbiguous) |
| 1023 | builder:PrependUOffsetTRelativeSlot(46, anyAmbiguous, 0) |
| 1024 | end |
| 1025 | |
| 1026 | function Monster.AddVectorOfEnums(builder, vectorOfEnums) |
| 1027 | builder:PrependUOffsetTRelativeSlot(47, vectorOfEnums, 0) |
| 1028 | end |
| 1029 | |
| 1030 | function Monster.StartVectorOfEnumsVector(builder, numElems) |
| 1031 | return builder:StartVector(1, numElems, 1) |
| 1032 | end |
| 1033 | |
| 1034 | function Monster.AddSignedEnum(builder, signedEnum) |
| 1035 | builder:PrependInt8Slot(48, signedEnum, -1) |
| 1036 | end |
| 1037 | |
| 1038 | function Monster.AddTestrequirednestedflatbuffer(builder, testrequirednestedflatbuffer) |
| 1039 | builder:PrependUOffsetTRelativeSlot(49, testrequirednestedflatbuffer, 0) |
| 1040 | end |
| 1041 | |
| 1042 | function Monster.StartTestrequirednestedflatbufferVector(builder, numElems) |
| 1043 | return builder:StartVector(1, numElems, 1) |
| 1044 | end |
| 1045 | |
| 1046 | function Monster.AddScalarKeySortedTables(builder, scalarKeySortedTables) |
| 1047 | builder:PrependUOffsetTRelativeSlot(50, scalarKeySortedTables, 0) |
| 1048 | end |
| 1049 | |
| 1050 | function Monster.StartScalarKeySortedTablesVector(builder, numElems) |
| 1051 | return builder:StartVector(4, numElems, 4) |
| 1052 | end |
| 1053 | |
| 1054 | function Monster.AddNativeInline(builder, nativeInline) |
| 1055 | builder:PrependStructSlot(51, nativeInline, 0) |
| 1056 | end |
| 1057 | |
| 1058 | function Monster.AddLongEnumNonEnumDefault(builder, longEnumNonEnumDefault) |
| 1059 | builder:PrependUint64Slot(52, longEnumNonEnumDefault, 0) |
| 1060 | end |
| 1061 | |
| 1062 | function Monster.AddLongEnumNormalDefault(builder, longEnumNormalDefault) |
| 1063 | builder:PrependUint64Slot(53, longEnumNormalDefault, 2) |
| 1064 | end |
| 1065 | |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 1066 | function Monster.AddNanDefault(builder, nanDefault) |
| 1067 | builder:PrependFloat32Slot(54, nanDefault, nan) |
| 1068 | end |
| 1069 | |
| 1070 | function Monster.AddInfDefault(builder, infDefault) |
| 1071 | builder:PrependFloat32Slot(55, infDefault, inf) |
| 1072 | end |
| 1073 | |
| 1074 | function Monster.AddPositiveInfDefault(builder, positiveInfDefault) |
| 1075 | builder:PrependFloat32Slot(56, positiveInfDefault, inf) |
| 1076 | end |
| 1077 | |
| 1078 | function Monster.AddInfinityDefault(builder, infinityDefault) |
| 1079 | builder:PrependFloat32Slot(57, infinityDefault, inf) |
| 1080 | end |
| 1081 | |
| 1082 | function Monster.AddPositiveInfinityDefault(builder, positiveInfinityDefault) |
| 1083 | builder:PrependFloat32Slot(58, positiveInfinityDefault, inf) |
| 1084 | end |
| 1085 | |
| 1086 | function Monster.AddNegativeInfDefault(builder, negativeInfDefault) |
| 1087 | builder:PrependFloat32Slot(59, negativeInfDefault, -inf) |
| 1088 | end |
| 1089 | |
| 1090 | function Monster.AddNegativeInfinityDefault(builder, negativeInfinityDefault) |
| 1091 | builder:PrependFloat32Slot(60, negativeInfinityDefault, -inf) |
| 1092 | end |
| 1093 | |
| 1094 | function Monster.AddDoubleInfDefault(builder, doubleInfDefault) |
| 1095 | builder:PrependFloat64Slot(61, doubleInfDefault, inf) |
| 1096 | end |
| 1097 | |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 1098 | function Monster.End(builder) |
| 1099 | return builder:EndObject() |
| 1100 | end |
| 1101 | |
| 1102 | return Monster |