// 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 AvatarBaseTemplateOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

impl<'a> AvatarBaseTemplate<'a> {
  pub const VT_ID: flatbuffers::VOffsetT = 4;
  pub const VT_CODE_NAME: flatbuffers::VOffsetT = 6;
  pub const VT_NAME: flatbuffers::VOffsetT = 8;
  pub const VT_FULL_NAME: flatbuffers::VOffsetT = 10;
  pub const VT_AUDIO_EVENT_REPLACE_PARAM: flatbuffers::VOffsetT = 12;
  pub const VT_AUDIO_BANK: flatbuffers::VOffsetT = 14;
  pub const VT_HIT_TYPES: flatbuffers::VOffsetT = 16;
  pub const VT_ELEMENT_TYPES: flatbuffers::VOffsetT = 18;
  pub const VT_UNK_1: flatbuffers::VOffsetT = 20;
  pub const VT_GENDER: flatbuffers::VOffsetT = 22;
  pub const VT_CAMP: flatbuffers::VOffsetT = 24;
  pub const VT_UNK_2: flatbuffers::VOffsetT = 26;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    AvatarBaseTemplate { _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 AvatarBaseTemplateArgs<'args>
  ) -> flatbuffers::WIPOffset<AvatarBaseTemplate<'bldr>> {
    let mut builder = AvatarBaseTemplateBuilder::new(_fbb);
    if let Some(x) = args.unk_2 { builder.add_unk_2(x); }
    builder.add_camp(args.camp);
    builder.add_gender(args.gender);
    builder.add_unk_1(args.unk_1);
    if let Some(x) = args.element_types { builder.add_element_types(x); }
    if let Some(x) = args.hit_types { builder.add_hit_types(x); }
    if let Some(x) = args.audio_bank { builder.add_audio_bank(x); }
    if let Some(x) = args.audio_event_replace_param { builder.add_audio_event_replace_param(x); }
    if let Some(x) = args.full_name { builder.add_full_name(x); }
    if let Some(x) = args.name { builder.add_name(x); }
    if let Some(x) = args.code_name { builder.add_code_name(x); }
    builder.add_id(args.id);
    builder.finish()
  }


  #[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>(AvatarBaseTemplate::VT_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn code_name(&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>>(AvatarBaseTemplate::VT_CODE_NAME, None)}
  }
  #[inline]
  pub fn name(&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>>(AvatarBaseTemplate::VT_NAME, None)}
  }
  #[inline]
  pub fn full_name(&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>>(AvatarBaseTemplate::VT_FULL_NAME, None)}
  }
  #[inline]
  pub fn audio_event_replace_param(&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>>(AvatarBaseTemplate::VT_AUDIO_EVENT_REPLACE_PARAM, None)}
  }
  #[inline]
  pub fn audio_bank(&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>>(AvatarBaseTemplate::VT_AUDIO_BANK, None)}
  }
  #[inline]
  pub fn hit_types(&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>>>(AvatarBaseTemplate::VT_HIT_TYPES, None)}
  }
  #[inline]
  pub fn element_types(&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>>>(AvatarBaseTemplate::VT_ELEMENT_TYPES, None)}
  }
  #[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>(AvatarBaseTemplate::VT_UNK_1, Some(0)).unwrap()}
  }
  #[inline]
  pub fn gender(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(AvatarBaseTemplate::VT_GENDER, Some(0)).unwrap()}
  }
  #[inline]
  pub fn camp(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(AvatarBaseTemplate::VT_CAMP, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_2(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
    // 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<&'a str>>>>(AvatarBaseTemplate::VT_UNK_2, None)}
  }
}

impl flatbuffers::Verifiable for AvatarBaseTemplate<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<u32>("id", Self::VT_ID, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("code_name", Self::VT_CODE_NAME, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("full_name", Self::VT_FULL_NAME, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("audio_event_replace_param", Self::VT_AUDIO_EVENT_REPLACE_PARAM, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("audio_bank", Self::VT_AUDIO_BANK, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("hit_types", Self::VT_HIT_TYPES, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("element_types", Self::VT_ELEMENT_TYPES, false)?
     .visit_field::<i32>("unk_1", Self::VT_UNK_1, false)?
     .visit_field::<u32>("gender", Self::VT_GENDER, false)?
     .visit_field::<u32>("camp", Self::VT_CAMP, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>("unk_2", Self::VT_UNK_2, false)?
     .finish();
    Ok(())
  }
}
pub struct AvatarBaseTemplateArgs<'a> {
    pub id: u32,
    pub code_name: Option<flatbuffers::WIPOffset<&'a str>>,
    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
    pub full_name: Option<flatbuffers::WIPOffset<&'a str>>,
    pub audio_event_replace_param: Option<flatbuffers::WIPOffset<&'a str>>,
    pub audio_bank: Option<flatbuffers::WIPOffset<&'a str>>,
    pub hit_types: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
    pub element_types: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
    pub unk_1: i32,
    pub gender: u32,
    pub camp: u32,
    pub unk_2: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
}
impl<'a> Default for AvatarBaseTemplateArgs<'a> {
  #[inline]
  fn default() -> Self {
    AvatarBaseTemplateArgs {
      id: 0,
      code_name: None,
      name: None,
      full_name: None,
      audio_event_replace_param: None,
      audio_bank: None,
      hit_types: None,
      element_types: None,
      unk_1: 0,
      gender: 0,
      camp: 0,
      unk_2: None,
    }
  }
}

pub struct AvatarBaseTemplateBuilder<'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> AvatarBaseTemplateBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_id(&mut self, id: u32) {
    self.fbb_.push_slot::<u32>(AvatarBaseTemplate::VT_ID, id, 0);
  }
  #[inline]
  pub fn add_code_name(&mut self, code_name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarBaseTemplate::VT_CODE_NAME, code_name);
  }
  #[inline]
  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarBaseTemplate::VT_NAME, name);
  }
  #[inline]
  pub fn add_full_name(&mut self, full_name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarBaseTemplate::VT_FULL_NAME, full_name);
  }
  #[inline]
  pub fn add_audio_event_replace_param(&mut self, audio_event_replace_param: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarBaseTemplate::VT_AUDIO_EVENT_REPLACE_PARAM, audio_event_replace_param);
  }
  #[inline]
  pub fn add_audio_bank(&mut self, audio_bank: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarBaseTemplate::VT_AUDIO_BANK, audio_bank);
  }
  #[inline]
  pub fn add_hit_types(&mut self, hit_types: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarBaseTemplate::VT_HIT_TYPES, hit_types);
  }
  #[inline]
  pub fn add_element_types(&mut self, element_types: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarBaseTemplate::VT_ELEMENT_TYPES, element_types);
  }
  #[inline]
  pub fn add_unk_1(&mut self, unk_1: i32) {
    self.fbb_.push_slot::<i32>(AvatarBaseTemplate::VT_UNK_1, unk_1, 0);
  }
  #[inline]
  pub fn add_gender(&mut self, gender: u32) {
    self.fbb_.push_slot::<u32>(AvatarBaseTemplate::VT_GENDER, gender, 0);
  }
  #[inline]
  pub fn add_camp(&mut self, camp: u32) {
    self.fbb_.push_slot::<u32>(AvatarBaseTemplate::VT_CAMP, camp, 0);
  }
  #[inline]
  pub fn add_unk_2(&mut self, unk_2: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(AvatarBaseTemplate::VT_UNK_2, unk_2);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> AvatarBaseTemplateBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    AvatarBaseTemplateBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<AvatarBaseTemplate<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for AvatarBaseTemplate<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("AvatarBaseTemplate");
      ds.field("id", &self.id());
      ds.field("code_name", &self.code_name());
      ds.field("name", &self.name());
      ds.field("full_name", &self.full_name());
      ds.field("audio_event_replace_param", &self.audio_event_replace_param());
      ds.field("audio_bank", &self.audio_bank());
      ds.field("hit_types", &self.hit_types());
      ds.field("element_types", &self.element_types());
      ds.field("unk_1", &self.unk_1());
      ds.field("gender", &self.gender());
      ds.field("camp", &self.camp());
      ds.field("unk_2", &self.unk_2());
      ds.finish()
  }
}
pub enum AvatarBaseTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

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

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

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

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

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