// automatically generated by the FlatBuffers compiler, do not modify


// @generated

use core::mem;
use core::cmp::Ordering;

extern crate flatbuffers;
use self::flatbuffers::{EndianScalar, Follow};

// struct RefineCost, aligned to 4
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq)]
pub struct RefineCost(pub [u8; 8]);
impl Default for RefineCost { 
  fn default() -> Self { 
    Self([0; 8])
  }
}
impl core::fmt::Debug for RefineCost {
  fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
    f.debug_struct("RefineCost")
      .field("item_id", &self.item_id())
      .field("number", &self.number())
      .finish()
  }
}

impl flatbuffers::SimpleToVerifyInSlice for RefineCost {}
impl<'a> flatbuffers::Follow<'a> for RefineCost {
  type Inner = &'a RefineCost;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    <&'a RefineCost>::follow(buf, loc)
  }
}
impl<'a> flatbuffers::Follow<'a> for &'a RefineCost {
  type Inner = &'a RefineCost;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    flatbuffers::follow_cast_ref::<RefineCost>(buf, loc)
  }
}
impl<'b> flatbuffers::Push for RefineCost {
    type Output = RefineCost;
    #[inline]
    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
        let src = ::core::slice::from_raw_parts(self as *const RefineCost as *const u8, <Self as flatbuffers::Push>::size());
        dst.copy_from_slice(src);
    }
    #[inline]
    fn alignment() -> flatbuffers::PushAlignment {
        flatbuffers::PushAlignment::new(4)
    }
}

impl<'a> flatbuffers::Verifiable for RefineCost {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.in_buffer::<Self>(pos)
  }
}

impl<'a> RefineCost {
  #[allow(clippy::too_many_arguments)]
  pub fn new(
    item_id: u32,
    number: i32,
  ) -> Self {
    let mut s = Self([0; 8]);
    s.set_item_id(item_id);
    s.set_number(number);
    s
  }

  pub fn item_id(&self) -> u32 {
    let mut mem = core::mem::MaybeUninit::<<u32 as EndianScalar>::Scalar>::uninit();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    EndianScalar::from_little_endian(unsafe {
      core::ptr::copy_nonoverlapping(
        self.0[0..].as_ptr(),
        mem.as_mut_ptr() as *mut u8,
        core::mem::size_of::<<u32 as EndianScalar>::Scalar>(),
      );
      mem.assume_init()
    })
  }

  pub fn set_item_id(&mut self, x: u32) {
    let x_le = x.to_little_endian();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    unsafe {
      core::ptr::copy_nonoverlapping(
        &x_le as *const _ as *const u8,
        self.0[0..].as_mut_ptr(),
        core::mem::size_of::<<u32 as EndianScalar>::Scalar>(),
      );
    }
  }

  pub fn number(&self) -> i32 {
    let mut mem = core::mem::MaybeUninit::<<i32 as EndianScalar>::Scalar>::uninit();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    EndianScalar::from_little_endian(unsafe {
      core::ptr::copy_nonoverlapping(
        self.0[4..].as_ptr(),
        mem.as_mut_ptr() as *mut u8,
        core::mem::size_of::<<i32 as EndianScalar>::Scalar>(),
      );
      mem.assume_init()
    })
  }

  pub fn set_number(&mut self, x: i32) {
    let x_le = x.to_little_endian();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    unsafe {
      core::ptr::copy_nonoverlapping(
        &x_le as *const _ as *const u8,
        self.0[4..].as_mut_ptr(),
        core::mem::size_of::<<i32 as EndianScalar>::Scalar>(),
      );
    }
  }

}

pub enum AvatarLevelAdvanceTemplateOffset {}
#[derive(Copy, Clone, PartialEq)]

pub struct AvatarLevelAdvanceTemplate<'a> {
  pub _tab: flatbuffers::Table<'a>,
}

impl<'a> flatbuffers::Follow<'a> for AvatarLevelAdvanceTemplate<'a> {
  type Inner = AvatarLevelAdvanceTemplate<'a>;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    Self { _tab: flatbuffers::Table::new(buf, loc) }
  }
}

impl<'a> AvatarLevelAdvanceTemplate<'a> {
  pub const VT_AVATAR_ID: flatbuffers::VOffsetT = 4;
  pub const VT_ID: flatbuffers::VOffsetT = 6;
  pub const VT_MIN_LEVEL: flatbuffers::VOffsetT = 8;
  pub const VT_MAX_LEVEL: flatbuffers::VOffsetT = 10;
  pub const VT_HP_MAX: flatbuffers::VOffsetT = 12;
  pub const VT_UNK_5: flatbuffers::VOffsetT = 14;
  pub const VT_UNK_6: flatbuffers::VOffsetT = 16;
  pub const VT_ATTACK: flatbuffers::VOffsetT = 18;
  pub const VT_DEFENCE: flatbuffers::VOffsetT = 20;
  pub const VT_UNK_9: flatbuffers::VOffsetT = 22;
  pub const VT_UNK_10: flatbuffers::VOffsetT = 24;
  pub const VT_UNK_11: flatbuffers::VOffsetT = 26;
  pub const VT_UNK_12: flatbuffers::VOffsetT = 28;
  pub const VT_UNK_13: flatbuffers::VOffsetT = 30;
  pub const VT_UNK_14: flatbuffers::VOffsetT = 32;
  pub const VT_UNK_15: flatbuffers::VOffsetT = 34;
  pub const VT_UNK_16: flatbuffers::VOffsetT = 36;
  pub const VT_UNK_17: flatbuffers::VOffsetT = 38;
  pub const VT_UNK_18: flatbuffers::VOffsetT = 40;
  pub const VT_PROMOTION_COSTS: flatbuffers::VOffsetT = 42;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    AvatarLevelAdvanceTemplate { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args AvatarLevelAdvanceTemplateArgs<'args>
  ) -> flatbuffers::WIPOffset<AvatarLevelAdvanceTemplate<'bldr>> {
    let mut builder = AvatarLevelAdvanceTemplateBuilder::new(_fbb);
    if let Some(x) = args.promotion_costs { builder.add_promotion_costs(x); }
    if let Some(x) = args.unk_18 { builder.add_unk_18(x); }
    builder.add_unk_17(args.unk_17);
    builder.add_unk_16(args.unk_16);
    builder.add_unk_15(args.unk_15);
    builder.add_unk_14(args.unk_14);
    builder.add_unk_13(args.unk_13);
    builder.add_unk_12(args.unk_12);
    builder.add_unk_11(args.unk_11);
    builder.add_unk_10(args.unk_10);
    builder.add_unk_9(args.unk_9);
    builder.add_defence(args.defence);
    builder.add_attack(args.attack);
    builder.add_unk_6(args.unk_6);
    builder.add_unk_5(args.unk_5);
    builder.add_hp_max(args.hp_max);
    builder.add_max_level(args.max_level);
    builder.add_min_level(args.min_level);
    builder.add_id(args.id);
    builder.add_avatar_id(args.avatar_id);
    builder.finish()
  }


  #[inline]
  pub fn avatar_id(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(AvatarLevelAdvanceTemplate::VT_AVATAR_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn id(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(AvatarLevelAdvanceTemplate::VT_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn min_level(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(AvatarLevelAdvanceTemplate::VT_MIN_LEVEL, Some(0)).unwrap()}
  }
  #[inline]
  pub fn max_level(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(AvatarLevelAdvanceTemplate::VT_MAX_LEVEL, Some(0)).unwrap()}
  }
  #[inline]
  pub fn hp_max(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_HP_MAX, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_5(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_5, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_6(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_6, Some(0)).unwrap()}
  }
  #[inline]
  pub fn attack(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_ATTACK, Some(0)).unwrap()}
  }
  #[inline]
  pub fn defence(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_DEFENCE, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_9(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_9, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_10(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_10, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_11(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_11, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_12(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_12, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_13(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_13, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_14(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_14, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_15(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_15, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_16(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_16, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_17(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_17, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_18(&self) -> Option<flatbuffers::Vector<'a, i32>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(AvatarLevelAdvanceTemplate::VT_UNK_18, None)}
  }
  #[inline]
  pub fn promotion_costs(&self) -> Option<flatbuffers::Vector<'a, RefineCost>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, RefineCost>>>(AvatarLevelAdvanceTemplate::VT_PROMOTION_COSTS, None)}
  }
}

impl flatbuffers::Verifiable for AvatarLevelAdvanceTemplate<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<u32>("avatar_id", Self::VT_AVATAR_ID, false)?
     .visit_field::<u32>("id", Self::VT_ID, false)?
     .visit_field::<u32>("min_level", Self::VT_MIN_LEVEL, false)?
     .visit_field::<u32>("max_level", Self::VT_MAX_LEVEL, false)?
     .visit_field::<i32>("hp_max", Self::VT_HP_MAX, false)?
     .visit_field::<i32>("unk_5", Self::VT_UNK_5, false)?
     .visit_field::<i32>("unk_6", Self::VT_UNK_6, false)?
     .visit_field::<i32>("attack", Self::VT_ATTACK, false)?
     .visit_field::<i32>("defence", Self::VT_DEFENCE, false)?
     .visit_field::<i32>("unk_9", Self::VT_UNK_9, false)?
     .visit_field::<i32>("unk_10", Self::VT_UNK_10, false)?
     .visit_field::<i32>("unk_11", Self::VT_UNK_11, false)?
     .visit_field::<i32>("unk_12", Self::VT_UNK_12, false)?
     .visit_field::<i32>("unk_13", Self::VT_UNK_13, false)?
     .visit_field::<i32>("unk_14", Self::VT_UNK_14, false)?
     .visit_field::<i32>("unk_15", Self::VT_UNK_15, false)?
     .visit_field::<i32>("unk_16", Self::VT_UNK_16, false)?
     .visit_field::<i32>("unk_17", Self::VT_UNK_17, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_18", Self::VT_UNK_18, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, RefineCost>>>("promotion_costs", Self::VT_PROMOTION_COSTS, false)?
     .finish();
    Ok(())
  }
}
pub struct AvatarLevelAdvanceTemplateArgs<'a> {
    pub avatar_id: u32,
    pub id: u32,
    pub min_level: u32,
    pub max_level: u32,
    pub hp_max: i32,
    pub unk_5: i32,
    pub unk_6: i32,
    pub attack: i32,
    pub defence: i32,
    pub unk_9: i32,
    pub unk_10: i32,
    pub unk_11: i32,
    pub unk_12: i32,
    pub unk_13: i32,
    pub unk_14: i32,
    pub unk_15: i32,
    pub unk_16: i32,
    pub unk_17: i32,
    pub unk_18: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
    pub promotion_costs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, RefineCost>>>,
}
impl<'a> Default for AvatarLevelAdvanceTemplateArgs<'a> {
  #[inline]
  fn default() -> Self {
    AvatarLevelAdvanceTemplateArgs {
      avatar_id: 0,
      id: 0,
      min_level: 0,
      max_level: 0,
      hp_max: 0,
      unk_5: 0,
      unk_6: 0,
      attack: 0,
      defence: 0,
      unk_9: 0,
      unk_10: 0,
      unk_11: 0,
      unk_12: 0,
      unk_13: 0,
      unk_14: 0,
      unk_15: 0,
      unk_16: 0,
      unk_17: 0,
      unk_18: None,
      promotion_costs: None,
    }
  }
}

pub struct AvatarLevelAdvanceTemplateBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> AvatarLevelAdvanceTemplateBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_avatar_id(&mut self, avatar_id: u32) {
    self.fbb_.push_slot::<u32>(AvatarLevelAdvanceTemplate::VT_AVATAR_ID, avatar_id, 0);
  }
  #[inline]
  pub fn add_id(&mut self, id: u32) {
    self.fbb_.push_slot::<u32>(AvatarLevelAdvanceTemplate::VT_ID, id, 0);
  }
  #[inline]
  pub fn add_min_level(&mut self, min_level: u32) {
    self.fbb_.push_slot::<u32>(AvatarLevelAdvanceTemplate::VT_MIN_LEVEL, min_level, 0);
  }
  #[inline]
  pub fn add_max_level(&mut self, max_level: u32) {
    self.fbb_.push_slot::<u32>(AvatarLevelAdvanceTemplate::VT_MAX_LEVEL, max_level, 0);
  }
  #[inline]
  pub fn add_hp_max(&mut self, hp_max: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_HP_MAX, hp_max, 0);
  }
  #[inline]
  pub fn add_unk_5(&mut self, unk_5: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_5, unk_5, 0);
  }
  #[inline]
  pub fn add_unk_6(&mut self, unk_6: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_6, unk_6, 0);
  }
  #[inline]
  pub fn add_attack(&mut self, attack: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_ATTACK, attack, 0);
  }
  #[inline]
  pub fn add_defence(&mut self, defence: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_DEFENCE, defence, 0);
  }
  #[inline]
  pub fn add_unk_9(&mut self, unk_9: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_9, unk_9, 0);
  }
  #[inline]
  pub fn add_unk_10(&mut self, unk_10: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_10, unk_10, 0);
  }
  #[inline]
  pub fn add_unk_11(&mut self, unk_11: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_11, unk_11, 0);
  }
  #[inline]
  pub fn add_unk_12(&mut self, unk_12: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_12, unk_12, 0);
  }
  #[inline]
  pub fn add_unk_13(&mut self, unk_13: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_13, unk_13, 0);
  }
  #[inline]
  pub fn add_unk_14(&mut self, unk_14: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_14, unk_14, 0);
  }
  #[inline]
  pub fn add_unk_15(&mut self, unk_15: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_15, unk_15, 0);
  }
  #[inline]
  pub fn add_unk_16(&mut self, unk_16: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_16, unk_16, 0);
  }
  #[inline]
  pub fn add_unk_17(&mut self, unk_17: i32) {
    self.fbb_.push_slot::<i32>(AvatarLevelAdvanceTemplate::VT_UNK_17, unk_17, 0);
  }
  #[inline]
  pub fn add_unk_18(&mut self, unk_18: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarLevelAdvanceTemplate::VT_UNK_18, unk_18);
  }
  #[inline]
  pub fn add_promotion_costs(&mut self, promotion_costs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , RefineCost>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarLevelAdvanceTemplate::VT_PROMOTION_COSTS, promotion_costs);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> AvatarLevelAdvanceTemplateBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    AvatarLevelAdvanceTemplateBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<AvatarLevelAdvanceTemplate<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for AvatarLevelAdvanceTemplate<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("AvatarLevelAdvanceTemplate");
      ds.field("avatar_id", &self.avatar_id());
      ds.field("id", &self.id());
      ds.field("min_level", &self.min_level());
      ds.field("max_level", &self.max_level());
      ds.field("hp_max", &self.hp_max());
      ds.field("unk_5", &self.unk_5());
      ds.field("unk_6", &self.unk_6());
      ds.field("attack", &self.attack());
      ds.field("defence", &self.defence());
      ds.field("unk_9", &self.unk_9());
      ds.field("unk_10", &self.unk_10());
      ds.field("unk_11", &self.unk_11());
      ds.field("unk_12", &self.unk_12());
      ds.field("unk_13", &self.unk_13());
      ds.field("unk_14", &self.unk_14());
      ds.field("unk_15", &self.unk_15());
      ds.field("unk_16", &self.unk_16());
      ds.field("unk_17", &self.unk_17());
      ds.field("unk_18", &self.unk_18());
      ds.field("promotion_costs", &self.promotion_costs());
      ds.finish()
  }
}
pub enum AvatarLevelAdvanceTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]

pub struct AvatarLevelAdvanceTemplateTb<'a> {
  pub _tab: flatbuffers::Table<'a>,
}

impl<'a> flatbuffers::Follow<'a> for AvatarLevelAdvanceTemplateTb<'a> {
  type Inner = AvatarLevelAdvanceTemplateTb<'a>;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    Self { _tab: flatbuffers::Table::new(buf, loc) }
  }
}

impl<'a> AvatarLevelAdvanceTemplateTb<'a> {
  pub const VT_DATA: flatbuffers::VOffsetT = 4;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    AvatarLevelAdvanceTemplateTb { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args AvatarLevelAdvanceTemplateTbArgs<'args>
  ) -> flatbuffers::WIPOffset<AvatarLevelAdvanceTemplateTb<'bldr>> {
    let mut builder = AvatarLevelAdvanceTemplateTbBuilder::new(_fbb);
    if let Some(x) = args.data { builder.add_data(x); }
    builder.finish()
  }


  #[inline]
  pub fn data(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<AvatarLevelAdvanceTemplate<'a>>>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<AvatarLevelAdvanceTemplate>>>>(AvatarLevelAdvanceTemplateTb::VT_DATA, None)}
  }
}

impl flatbuffers::Verifiable for AvatarLevelAdvanceTemplateTb<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<AvatarLevelAdvanceTemplate>>>>("data", Self::VT_DATA, false)?
     .finish();
    Ok(())
  }
}
pub struct AvatarLevelAdvanceTemplateTbArgs<'a> {
    pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<AvatarLevelAdvanceTemplate<'a>>>>>,
}
impl<'a> Default for AvatarLevelAdvanceTemplateTbArgs<'a> {
  #[inline]
  fn default() -> Self {
    AvatarLevelAdvanceTemplateTbArgs {
      data: None,
    }
  }
}

pub struct AvatarLevelAdvanceTemplateTbBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> AvatarLevelAdvanceTemplateTbBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<AvatarLevelAdvanceTemplate<'b >>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarLevelAdvanceTemplateTb::VT_DATA, data);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> AvatarLevelAdvanceTemplateTbBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    AvatarLevelAdvanceTemplateTbBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<AvatarLevelAdvanceTemplateTb<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for AvatarLevelAdvanceTemplateTb<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("AvatarLevelAdvanceTemplateTb");
      ds.field("data", &self.data());
      ds.finish()
  }
}
