// 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};

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

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

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

impl<'a> YorozuyaLevelTemplate<'a> {
  pub const VT_LEVEL: flatbuffers::VOffsetT = 4;
  pub const VT_EXPERIENCE: flatbuffers::VOffsetT = 6;
  pub const VT_REWARD_ID: flatbuffers::VOffsetT = 8;
  pub const VT_UNK_1: flatbuffers::VOffsetT = 10;
  pub const VT_UNK_2: flatbuffers::VOffsetT = 12;
  pub const VT_UNK_3: flatbuffers::VOffsetT = 14;
  pub const VT_UNK_4: flatbuffers::VOffsetT = 16;
  pub const VT_UNK_5: flatbuffers::VOffsetT = 18;
  pub const VT_UNK_6: flatbuffers::VOffsetT = 20;
  pub const VT_UNK_7: flatbuffers::VOffsetT = 22;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    YorozuyaLevelTemplate { _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 YorozuyaLevelTemplateArgs<'args>
  ) -> flatbuffers::WIPOffset<YorozuyaLevelTemplate<'bldr>> {
    let mut builder = YorozuyaLevelTemplateBuilder::new(_fbb);
    if let Some(x) = args.unk_7 { builder.add_unk_7(x); }
    if let Some(x) = args.unk_6 { builder.add_unk_6(x); }
    if let Some(x) = args.unk_5 { builder.add_unk_5(x); }
    if let Some(x) = args.unk_4 { builder.add_unk_4(x); }
    if let Some(x) = args.unk_3 { builder.add_unk_3(x); }
    if let Some(x) = args.unk_2 { builder.add_unk_2(x); }
    builder.add_unk_1(args.unk_1);
    builder.add_reward_id(args.reward_id);
    builder.add_experience(args.experience);
    builder.add_level(args.level);
    builder.finish()
  }


  #[inline]
  pub fn level(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(YorozuyaLevelTemplate::VT_LEVEL, Some(0)).unwrap()}
  }
  #[inline]
  pub fn experience(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(YorozuyaLevelTemplate::VT_EXPERIENCE, Some(0)).unwrap()}
  }
  #[inline]
  pub fn reward_id(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(YorozuyaLevelTemplate::VT_REWARD_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_1(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(YorozuyaLevelTemplate::VT_UNK_1, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_2(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(YorozuyaLevelTemplate::VT_UNK_2, None)}
  }
  #[inline]
  pub fn unk_3(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(YorozuyaLevelTemplate::VT_UNK_3, None)}
  }
  #[inline]
  pub fn unk_4(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(YorozuyaLevelTemplate::VT_UNK_4, None)}
  }
  #[inline]
  pub fn unk_5(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(YorozuyaLevelTemplate::VT_UNK_5, None)}
  }
  #[inline]
  pub fn unk_6(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(YorozuyaLevelTemplate::VT_UNK_6, None)}
  }
  #[inline]
  pub fn unk_7(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(YorozuyaLevelTemplate::VT_UNK_7, None)}
  }
}

impl flatbuffers::Verifiable for YorozuyaLevelTemplate<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<u32>("level", Self::VT_LEVEL, false)?
     .visit_field::<u32>("experience", Self::VT_EXPERIENCE, false)?
     .visit_field::<u32>("reward_id", Self::VT_REWARD_ID, false)?
     .visit_field::<i32>("unk_1", Self::VT_UNK_1, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_2", Self::VT_UNK_2, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_3", Self::VT_UNK_3, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_4", Self::VT_UNK_4, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_5", Self::VT_UNK_5, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_6", Self::VT_UNK_6, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_7", Self::VT_UNK_7, false)?
     .finish();
    Ok(())
  }
}
pub struct YorozuyaLevelTemplateArgs<'a> {
    pub level: u32,
    pub experience: u32,
    pub reward_id: u32,
    pub unk_1: i32,
    pub unk_2: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_3: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_4: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_5: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_6: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_7: Option<flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for YorozuyaLevelTemplateArgs<'a> {
  #[inline]
  fn default() -> Self {
    YorozuyaLevelTemplateArgs {
      level: 0,
      experience: 0,
      reward_id: 0,
      unk_1: 0,
      unk_2: None,
      unk_3: None,
      unk_4: None,
      unk_5: None,
      unk_6: None,
      unk_7: None,
    }
  }
}

pub struct YorozuyaLevelTemplateBuilder<'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> YorozuyaLevelTemplateBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_level(&mut self, level: u32) {
    self.fbb_.push_slot::<u32>(YorozuyaLevelTemplate::VT_LEVEL, level, 0);
  }
  #[inline]
  pub fn add_experience(&mut self, experience: u32) {
    self.fbb_.push_slot::<u32>(YorozuyaLevelTemplate::VT_EXPERIENCE, experience, 0);
  }
  #[inline]
  pub fn add_reward_id(&mut self, reward_id: u32) {
    self.fbb_.push_slot::<u32>(YorozuyaLevelTemplate::VT_REWARD_ID, reward_id, 0);
  }
  #[inline]
  pub fn add_unk_1(&mut self, unk_1: i32) {
    self.fbb_.push_slot::<i32>(YorozuyaLevelTemplate::VT_UNK_1, unk_1, 0);
  }
  #[inline]
  pub fn add_unk_2(&mut self, unk_2: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(YorozuyaLevelTemplate::VT_UNK_2, unk_2);
  }
  #[inline]
  pub fn add_unk_3(&mut self, unk_3: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(YorozuyaLevelTemplate::VT_UNK_3, unk_3);
  }
  #[inline]
  pub fn add_unk_4(&mut self, unk_4: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(YorozuyaLevelTemplate::VT_UNK_4, unk_4);
  }
  #[inline]
  pub fn add_unk_5(&mut self, unk_5: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(YorozuyaLevelTemplate::VT_UNK_5, unk_5);
  }
  #[inline]
  pub fn add_unk_6(&mut self, unk_6: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(YorozuyaLevelTemplate::VT_UNK_6, unk_6);
  }
  #[inline]
  pub fn add_unk_7(&mut self, unk_7: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(YorozuyaLevelTemplate::VT_UNK_7, unk_7);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> YorozuyaLevelTemplateBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    YorozuyaLevelTemplateBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<YorozuyaLevelTemplate<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for YorozuyaLevelTemplate<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("YorozuyaLevelTemplate");
      ds.field("level", &self.level());
      ds.field("experience", &self.experience());
      ds.field("reward_id", &self.reward_id());
      ds.field("unk_1", &self.unk_1());
      ds.field("unk_2", &self.unk_2());
      ds.field("unk_3", &self.unk_3());
      ds.field("unk_4", &self.unk_4());
      ds.field("unk_5", &self.unk_5());
      ds.field("unk_6", &self.unk_6());
      ds.field("unk_7", &self.unk_7());
      ds.finish()
  }
}
pub enum YorozuyaLevelTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

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

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    YorozuyaLevelTemplateTb { _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 YorozuyaLevelTemplateTbArgs<'args>
  ) -> flatbuffers::WIPOffset<YorozuyaLevelTemplateTb<'bldr>> {
    let mut builder = YorozuyaLevelTemplateTbBuilder::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<YorozuyaLevelTemplate<'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<YorozuyaLevelTemplate>>>>(YorozuyaLevelTemplateTb::VT_DATA, None)}
  }
}

impl flatbuffers::Verifiable for YorozuyaLevelTemplateTb<'_> {
  #[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<YorozuyaLevelTemplate>>>>("data", Self::VT_DATA, false)?
     .finish();
    Ok(())
  }
}
pub struct YorozuyaLevelTemplateTbArgs<'a> {
    pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<YorozuyaLevelTemplate<'a>>>>>,
}
impl<'a> Default for YorozuyaLevelTemplateTbArgs<'a> {
  #[inline]
  fn default() -> Self {
    YorozuyaLevelTemplateTbArgs {
      data: None,
    }
  }
}

pub struct YorozuyaLevelTemplateTbBuilder<'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> YorozuyaLevelTemplateTbBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<YorozuyaLevelTemplate<'b >>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(YorozuyaLevelTemplateTb::VT_DATA, data);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> YorozuyaLevelTemplateTbBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    YorozuyaLevelTemplateTbBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<YorozuyaLevelTemplateTb<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

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