1 // automatically generated by the FlatBuffers compiler, do not modify
2
3
4 #ifndef FLATBUFFERS_GENERATED_MONSTER_MYGAME_SAMPLE_H_
5 #define FLATBUFFERS_GENERATED_MONSTER_MYGAME_SAMPLE_H_
6
7 #include "flatbuffers/flatbuffers.h"
8
9 namespace MyGame {
10 namespace Sample {
11
12 struct Vec3;
13
14 struct Monster;
15 struct MonsterT;
16
17 struct Weapon;
18 struct WeaponT;
19
20 enum Color {
21 Color_Red = 0,
22 Color_Green = 1,
23 Color_Blue = 2,
24 Color_MIN = Color_Red,
25 Color_MAX = Color_Blue
26 };
27
EnumNamesColor()28 inline const char **EnumNamesColor() {
29 static const char *names[] = {
30 "Red",
31 "Green",
32 "Blue",
33 nullptr
34 };
35 return names;
36 }
37
EnumNameColor(Color e)38 inline const char *EnumNameColor(Color e) {
39 const size_t index = static_cast<int>(e);
40 return EnumNamesColor()[index];
41 }
42
43 enum Equipment {
44 Equipment_NONE = 0,
45 Equipment_Weapon = 1,
46 Equipment_MIN = Equipment_NONE,
47 Equipment_MAX = Equipment_Weapon
48 };
49
EnumNamesEquipment()50 inline const char **EnumNamesEquipment() {
51 static const char *names[] = {
52 "NONE",
53 "Weapon",
54 nullptr
55 };
56 return names;
57 }
58
EnumNameEquipment(Equipment e)59 inline const char *EnumNameEquipment(Equipment e) {
60 const size_t index = static_cast<int>(e);
61 return EnumNamesEquipment()[index];
62 }
63
64 template<typename T> struct EquipmentTraits {
65 static const Equipment enum_value = Equipment_NONE;
66 };
67
68 template<> struct EquipmentTraits<Weapon> {
69 static const Equipment enum_value = Equipment_Weapon;
70 };
71
72 struct EquipmentUnion {
73 Equipment type;
74 flatbuffers::NativeTable *table;
75
76 EquipmentUnion() : type(Equipment_NONE), table(nullptr) {}
77 EquipmentUnion(EquipmentUnion&& u):
78 type(std::move(u.type)), table(std::move(u.table)) {}
79 EquipmentUnion(const EquipmentUnion &);
80 EquipmentUnion &operator=(const EquipmentUnion &);
81 ~EquipmentUnion() { Reset(); }
82
83 void Reset();
84
85 template <typename T>
86 void Set(T&& value) {
87 Reset();
88 type = EquipmentTraits<typename T::TableType>::enum_value;
89 if (type != Equipment_NONE) {
90 table = new T(std::forward<T>(value));
91 }
92 }
93
94 static flatbuffers::NativeTable *UnPack(const void *obj, Equipment type, const flatbuffers::resolver_function_t *resolver);
95 flatbuffers::Offset<void> Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const;
96
97 WeaponT *AsWeapon() {
98 return type == Equipment_Weapon ?
99 reinterpret_cast<WeaponT *>(table) : nullptr;
100 }
101 };
102
103 bool VerifyEquipment(flatbuffers::Verifier &verifier, const void *obj, Equipment type);
104 bool VerifyEquipmentVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types);
105
106 MANUALLY_ALIGNED_STRUCT(4) Vec3 FLATBUFFERS_FINAL_CLASS {
107 private:
108 float x_;
109 float y_;
110 float z_;
111
112 public:
113 Vec3() {
114 memset(this, 0, sizeof(Vec3));
115 }
116 Vec3(const Vec3 &_o) {
117 memcpy(this, &_o, sizeof(Vec3));
118 }
119 Vec3(float _x, float _y, float _z)
120 : x_(flatbuffers::EndianScalar(_x)),
121 y_(flatbuffers::EndianScalar(_y)),
122 z_(flatbuffers::EndianScalar(_z)) {
123 }
124 float x() const {
125 return flatbuffers::EndianScalar(x_);
126 }
127 void mutate_x(float _x) {
128 flatbuffers::WriteScalar(&x_, _x);
129 }
130 float y() const {
131 return flatbuffers::EndianScalar(y_);
132 }
133 void mutate_y(float _y) {
134 flatbuffers::WriteScalar(&y_, _y);
135 }
136 float z() const {
137 return flatbuffers::EndianScalar(z_);
138 }
139 void mutate_z(float _z) {
140 flatbuffers::WriteScalar(&z_, _z);
141 }
142 };
143 STRUCT_END(Vec3, 12);
144
145 struct MonsterT : public flatbuffers::NativeTable {
146 typedef Monster TableType;
147 std::unique_ptr<Vec3> pos;
148 int16_t mana;
149 int16_t hp;
150 std::string name;
151 std::vector<uint8_t> inventory;
152 Color color;
153 std::vector<std::unique_ptr<WeaponT>> weapons;
154 EquipmentUnion equipped;
155 MonsterT()
156 : mana(150),
157 hp(100),
158 color(Color_Blue) {
159 }
160 };
161
162 struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
163 typedef MonsterT NativeTableType;
164 enum {
165 VT_POS = 4,
166 VT_MANA = 6,
167 VT_HP = 8,
168 VT_NAME = 10,
169 VT_INVENTORY = 14,
170 VT_COLOR = 16,
171 VT_WEAPONS = 18,
172 VT_EQUIPPED_TYPE = 20,
173 VT_EQUIPPED = 22
174 };
175 const Vec3 *pos() const {
176 return GetStruct<const Vec3 *>(VT_POS);
177 }
178 Vec3 *mutable_pos() {
179 return GetStruct<Vec3 *>(VT_POS);
180 }
181 int16_t mana() const {
182 return GetField<int16_t>(VT_MANA, 150);
183 }
184 bool mutate_mana(int16_t _mana) {
185 return SetField(VT_MANA, _mana);
186 }
187 int16_t hp() const {
188 return GetField<int16_t>(VT_HP, 100);
189 }
190 bool mutate_hp(int16_t _hp) {
191 return SetField(VT_HP, _hp);
192 }
193 const flatbuffers::String *name() const {
194 return GetPointer<const flatbuffers::String *>(VT_NAME);
195 }
196 flatbuffers::String *mutable_name() {
197 return GetPointer<flatbuffers::String *>(VT_NAME);
198 }
199 const flatbuffers::Vector<uint8_t> *inventory() const {
200 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_INVENTORY);
201 }
202 flatbuffers::Vector<uint8_t> *mutable_inventory() {
203 return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_INVENTORY);
204 }
205 Color color() const {
206 return static_cast<Color>(GetField<int8_t>(VT_COLOR, 2));
207 }
208 bool mutate_color(Color _color) {
209 return SetField(VT_COLOR, static_cast<int8_t>(_color));
210 }
211 const flatbuffers::Vector<flatbuffers::Offset<Weapon>> *weapons() const {
212 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Weapon>> *>(VT_WEAPONS);
213 }
214 flatbuffers::Vector<flatbuffers::Offset<Weapon>> *mutable_weapons() {
215 return GetPointer<flatbuffers::Vector<flatbuffers::Offset<Weapon>> *>(VT_WEAPONS);
216 }
217 Equipment equipped_type() const {
218 return static_cast<Equipment>(GetField<uint8_t>(VT_EQUIPPED_TYPE, 0));
219 }
220 bool mutate_equipped_type(Equipment _equipped_type) {
221 return SetField(VT_EQUIPPED_TYPE, static_cast<uint8_t>(_equipped_type));
222 }
223 const void *equipped() const {
224 return GetPointer<const void *>(VT_EQUIPPED);
225 }
226 void *mutable_equipped() {
227 return GetPointer<void *>(VT_EQUIPPED);
228 }
229 bool Verify(flatbuffers::Verifier &verifier) const {
230 return VerifyTableStart(verifier) &&
231 VerifyField<Vec3>(verifier, VT_POS) &&
232 VerifyField<int16_t>(verifier, VT_MANA) &&
233 VerifyField<int16_t>(verifier, VT_HP) &&
234 VerifyField<flatbuffers::uoffset_t>(verifier, VT_NAME) &&
235 verifier.Verify(name()) &&
236 VerifyField<flatbuffers::uoffset_t>(verifier, VT_INVENTORY) &&
237 verifier.Verify(inventory()) &&
238 VerifyField<int8_t>(verifier, VT_COLOR) &&
239 VerifyField<flatbuffers::uoffset_t>(verifier, VT_WEAPONS) &&
240 verifier.Verify(weapons()) &&
241 verifier.VerifyVectorOfTables(weapons()) &&
242 VerifyField<uint8_t>(verifier, VT_EQUIPPED_TYPE) &&
243 VerifyField<flatbuffers::uoffset_t>(verifier, VT_EQUIPPED) &&
244 VerifyEquipment(verifier, equipped(), equipped_type()) &&
245 verifier.EndTable();
246 }
247 MonsterT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
248 void UnPackTo(MonsterT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
249 static flatbuffers::Offset<Monster> Pack(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
250 };
251
252 struct MonsterBuilder {
253 flatbuffers::FlatBufferBuilder &fbb_;
254 flatbuffers::uoffset_t start_;
255 void add_pos(const Vec3 *pos) {
256 fbb_.AddStruct(Monster::VT_POS, pos);
257 }
258 void add_mana(int16_t mana) {
259 fbb_.AddElement<int16_t>(Monster::VT_MANA, mana, 150);
260 }
261 void add_hp(int16_t hp) {
262 fbb_.AddElement<int16_t>(Monster::VT_HP, hp, 100);
263 }
264 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
265 fbb_.AddOffset(Monster::VT_NAME, name);
266 }
267 void add_inventory(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> inventory) {
268 fbb_.AddOffset(Monster::VT_INVENTORY, inventory);
269 }
270 void add_color(Color color) {
271 fbb_.AddElement<int8_t>(Monster::VT_COLOR, static_cast<int8_t>(color), 2);
272 }
273 void add_weapons(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Weapon>>> weapons) {
274 fbb_.AddOffset(Monster::VT_WEAPONS, weapons);
275 }
276 void add_equipped_type(Equipment equipped_type) {
277 fbb_.AddElement<uint8_t>(Monster::VT_EQUIPPED_TYPE, static_cast<uint8_t>(equipped_type), 0);
278 }
279 void add_equipped(flatbuffers::Offset<void> equipped) {
280 fbb_.AddOffset(Monster::VT_EQUIPPED, equipped);
281 }
282 MonsterBuilder(flatbuffers::FlatBufferBuilder &_fbb)
283 : fbb_(_fbb) {
284 start_ = fbb_.StartTable();
285 }
286 MonsterBuilder &operator=(const MonsterBuilder &);
287 flatbuffers::Offset<Monster> Finish() {
288 const auto end = fbb_.EndTable(start_, 10);
289 auto o = flatbuffers::Offset<Monster>(end);
290 return o;
291 }
292 };
293
294 inline flatbuffers::Offset<Monster> CreateMonster(
295 flatbuffers::FlatBufferBuilder &_fbb,
296 const Vec3 *pos = 0,
297 int16_t mana = 150,
298 int16_t hp = 100,
299 flatbuffers::Offset<flatbuffers::String> name = 0,
300 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> inventory = 0,
301 Color color = Color_Blue,
302 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Weapon>>> weapons = 0,
303 Equipment equipped_type = Equipment_NONE,
304 flatbuffers::Offset<void> equipped = 0) {
305 MonsterBuilder builder_(_fbb);
306 builder_.add_equipped(equipped);
307 builder_.add_weapons(weapons);
308 builder_.add_inventory(inventory);
309 builder_.add_name(name);
310 builder_.add_pos(pos);
311 builder_.add_hp(hp);
312 builder_.add_mana(mana);
313 builder_.add_equipped_type(equipped_type);
314 builder_.add_color(color);
315 return builder_.Finish();
316 }
317
318 inline flatbuffers::Offset<Monster> CreateMonsterDirect(
319 flatbuffers::FlatBufferBuilder &_fbb,
320 const Vec3 *pos = 0,
321 int16_t mana = 150,
322 int16_t hp = 100,
323 const char *name = nullptr,
324 const std::vector<uint8_t> *inventory = nullptr,
325 Color color = Color_Blue,
326 const std::vector<flatbuffers::Offset<Weapon>> *weapons = nullptr,
327 Equipment equipped_type = Equipment_NONE,
328 flatbuffers::Offset<void> equipped = 0) {
329 return MyGame::Sample::CreateMonster(
330 _fbb,
331 pos,
332 mana,
333 hp,
334 name ? _fbb.CreateString(name) : 0,
335 inventory ? _fbb.CreateVector<uint8_t>(*inventory) : 0,
336 color,
337 weapons ? _fbb.CreateVector<flatbuffers::Offset<Weapon>>(*weapons) : 0,
338 equipped_type,
339 equipped);
340 }
341
342 flatbuffers::Offset<Monster> CreateMonster(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
343
344 struct WeaponT : public flatbuffers::NativeTable {
345 typedef Weapon TableType;
346 std::string name;
347 int16_t damage;
348 WeaponT()
349 : damage(0) {
350 }
351 };
352
353 struct Weapon FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
354 typedef WeaponT NativeTableType;
355 enum {
356 VT_NAME = 4,
357 VT_DAMAGE = 6
358 };
359 const flatbuffers::String *name() const {
360 return GetPointer<const flatbuffers::String *>(VT_NAME);
361 }
362 flatbuffers::String *mutable_name() {
363 return GetPointer<flatbuffers::String *>(VT_NAME);
364 }
365 int16_t damage() const {
366 return GetField<int16_t>(VT_DAMAGE, 0);
367 }
368 bool mutate_damage(int16_t _damage) {
369 return SetField(VT_DAMAGE, _damage);
370 }
371 bool Verify(flatbuffers::Verifier &verifier) const {
372 return VerifyTableStart(verifier) &&
373 VerifyField<flatbuffers::uoffset_t>(verifier, VT_NAME) &&
374 verifier.Verify(name()) &&
375 VerifyField<int16_t>(verifier, VT_DAMAGE) &&
376 verifier.EndTable();
377 }
378 WeaponT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
379 void UnPackTo(WeaponT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
380 static flatbuffers::Offset<Weapon> Pack(flatbuffers::FlatBufferBuilder &_fbb, const WeaponT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
381 };
382
383 struct WeaponBuilder {
384 flatbuffers::FlatBufferBuilder &fbb_;
385 flatbuffers::uoffset_t start_;
386 void add_name(flatbuffers::Offset<flatbuffers::String> name) {
387 fbb_.AddOffset(Weapon::VT_NAME, name);
388 }
389 void add_damage(int16_t damage) {
390 fbb_.AddElement<int16_t>(Weapon::VT_DAMAGE, damage, 0);
391 }
392 WeaponBuilder(flatbuffers::FlatBufferBuilder &_fbb)
393 : fbb_(_fbb) {
394 start_ = fbb_.StartTable();
395 }
396 WeaponBuilder &operator=(const WeaponBuilder &);
397 flatbuffers::Offset<Weapon> Finish() {
398 const auto end = fbb_.EndTable(start_, 2);
399 auto o = flatbuffers::Offset<Weapon>(end);
400 return o;
401 }
402 };
403
404 inline flatbuffers::Offset<Weapon> CreateWeapon(
405 flatbuffers::FlatBufferBuilder &_fbb,
406 flatbuffers::Offset<flatbuffers::String> name = 0,
407 int16_t damage = 0) {
408 WeaponBuilder builder_(_fbb);
409 builder_.add_name(name);
410 builder_.add_damage(damage);
411 return builder_.Finish();
412 }
413
414 inline flatbuffers::Offset<Weapon> CreateWeaponDirect(
415 flatbuffers::FlatBufferBuilder &_fbb,
416 const char *name = nullptr,
417 int16_t damage = 0) {
418 return MyGame::Sample::CreateWeapon(
419 _fbb,
420 name ? _fbb.CreateString(name) : 0,
421 damage);
422 }
423
424 flatbuffers::Offset<Weapon> CreateWeapon(flatbuffers::FlatBufferBuilder &_fbb, const WeaponT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
425
426 inline MonsterT *Monster::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
427 auto _o = new MonsterT();
428 UnPackTo(_o, _resolver);
429 return _o;
430 }
431
432 inline void Monster::UnPackTo(MonsterT *_o, const flatbuffers::resolver_function_t *_resolver) const {
433 (void)_o;
434 (void)_resolver;
435 { auto _e = pos(); if (_e) _o->pos = std::unique_ptr<Vec3>(new Vec3(*_e)); };
436 { auto _e = mana(); _o->mana = _e; };
437 { auto _e = hp(); _o->hp = _e; };
438 { auto _e = name(); if (_e) _o->name = _e->str(); };
439 { auto _e = inventory(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->inventory.push_back(_e->Get(_i)); } };
440 { auto _e = color(); _o->color = _e; };
441 { auto _e = weapons(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->weapons.push_back(std::unique_ptr<WeaponT>(_e->Get(_i)->UnPack(_resolver))); } };
442 { auto _e = equipped_type(); _o->equipped.type = _e; };
443 { auto _e = equipped(); if (_e) _o->equipped.table = EquipmentUnion::UnPack(_e, equipped_type(),_resolver); };
444 }
445
446 inline flatbuffers::Offset<Monster> Monster::Pack(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
447 return CreateMonster(_fbb, _o, _rehasher);
448 }
449
450 inline flatbuffers::Offset<Monster> CreateMonster(flatbuffers::FlatBufferBuilder &_fbb, const MonsterT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
451 (void)_rehasher;
452 (void)_o;
453 auto _pos = _o->pos ? _o->pos.get() : 0;
454 auto _mana = _o->mana;
455 auto _hp = _o->hp;
456 auto _name = _o->name.size() ? _fbb.CreateString(_o->name) : 0;
457 auto _inventory = _o->inventory.size() ? _fbb.CreateVector(_o->inventory) : 0;
458 auto _color = _o->color;
459 auto _weapons = _o->weapons.size() ? _fbb.CreateVector<flatbuffers::Offset<Weapon>>(_o->weapons.size(), [&](size_t i) { return CreateWeapon(_fbb, _o->weapons[i].get(), _rehasher); }) : 0;
460 auto _equipped_type = _o->equipped.type;
461 auto _equipped = _o->equipped.Pack(_fbb);
462 return MyGame::Sample::CreateMonster(
463 _fbb,
464 _pos,
465 _mana,
466 _hp,
467 _name,
468 _inventory,
469 _color,
470 _weapons,
471 _equipped_type,
472 _equipped);
473 }
474
475 inline WeaponT *Weapon::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
476 auto _o = new WeaponT();
477 UnPackTo(_o, _resolver);
478 return _o;
479 }
480
481 inline void Weapon::UnPackTo(WeaponT *_o, const flatbuffers::resolver_function_t *_resolver) const {
482 (void)_o;
483 (void)_resolver;
484 { auto _e = name(); if (_e) _o->name = _e->str(); };
485 { auto _e = damage(); _o->damage = _e; };
486 }
487
488 inline flatbuffers::Offset<Weapon> Weapon::Pack(flatbuffers::FlatBufferBuilder &_fbb, const WeaponT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
489 return CreateWeapon(_fbb, _o, _rehasher);
490 }
491
492 inline flatbuffers::Offset<Weapon> CreateWeapon(flatbuffers::FlatBufferBuilder &_fbb, const WeaponT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
493 (void)_rehasher;
494 (void)_o;
495 auto _name = _o->name.size() ? _fbb.CreateString(_o->name) : 0;
496 auto _damage = _o->damage;
497 return MyGame::Sample::CreateWeapon(
498 _fbb,
499 _name,
500 _damage);
501 }
502
503 inline bool VerifyEquipment(flatbuffers::Verifier &verifier, const void *obj, Equipment type) {
504 switch (type) {
505 case Equipment_NONE: {
506 return true;
507 }
508 case Equipment_Weapon: {
509 auto ptr = reinterpret_cast<const Weapon *>(obj);
510 return verifier.VerifyTable(ptr);
511 }
512 default: return false;
513 }
514 }
515
516 inline bool VerifyEquipmentVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) {
517 if (values->size() != types->size()) return false;
518 for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
519 if (!VerifyEquipment(
520 verifier, values->Get(i), types->GetEnum<Equipment>(i))) {
521 return false;
522 }
523 }
524 return true;
525 }
526
527 inline flatbuffers::NativeTable *EquipmentUnion::UnPack(const void *obj, Equipment type, const flatbuffers::resolver_function_t *resolver) {
528 switch (type) {
529 case Equipment_Weapon: {
530 auto ptr = reinterpret_cast<const Weapon *>(obj);
531 return ptr->UnPack(resolver);
532 }
533 default: return nullptr;
534 }
535 }
536
537 inline flatbuffers::Offset<void> EquipmentUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const {
538 switch (type) {
539 case Equipment_Weapon: {
540 auto ptr = reinterpret_cast<const WeaponT *>(table);
541 return CreateWeapon(_fbb, ptr, _rehasher).Union();
542 }
543 default: return 0;
544 }
545 }
546
547 inline void EquipmentUnion::Reset() {
548 switch (type) {
549 case Equipment_Weapon: {
550 auto ptr = reinterpret_cast<WeaponT *>(table);
551 delete ptr;
552 break;
553 }
554 default: break;
555 }
556 table = nullptr;
557 type = Equipment_NONE;
558 }
559
560 inline const MyGame::Sample::Monster *GetMonster(const void *buf) {
561 return flatbuffers::GetRoot<MyGame::Sample::Monster>(buf);
562 }
563
564 inline Monster *GetMutableMonster(void *buf) {
565 return flatbuffers::GetMutableRoot<Monster>(buf);
566 }
567
568 inline bool VerifyMonsterBuffer(
569 flatbuffers::Verifier &verifier) {
570 return verifier.VerifyBuffer<MyGame::Sample::Monster>(nullptr);
571 }
572
573 inline void FinishMonsterBuffer(
574 flatbuffers::FlatBufferBuilder &fbb,
575 flatbuffers::Offset<MyGame::Sample::Monster> root) {
576 fbb.Finish(root);
577 }
578
579 inline std::unique_ptr<MonsterT> UnPackMonster(
580 const void *buf,
581 const flatbuffers::resolver_function_t *res = nullptr) {
582 return std::unique_ptr<MonsterT>(GetMonster(buf)->UnPack(res));
583 }
584
585 } // namespace Sample
586 } // namespace MyGame
587
588 #endif // FLATBUFFERS_GENERATED_MONSTER_MYGAME_SAMPLE_H_
589