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

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

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

impl<'a> PlayerSkinConfigTemplate<'a> {
  pub const VT_PLAYER_SKIN_ID: flatbuffers::VOffsetT = 4;
  pub const VT_GENDER: flatbuffers::VOffsetT = 6;
  pub const VT_NEEDS_UNLOCK: flatbuffers::VOffsetT = 8;
  pub const VT_UNK_3: flatbuffers::VOffsetT = 10;
  pub const VT_UNK_4: flatbuffers::VOffsetT = 12;
  pub const VT_UNK_5: flatbuffers::VOffsetT = 14;
  pub const VT_UNK_6: flatbuffers::VOffsetT = 16;
  pub const VT_UNK_7: flatbuffers::VOffsetT = 18;
  pub const VT_UNK_8: flatbuffers::VOffsetT = 20;
  pub const VT_UNK_9: flatbuffers::VOffsetT = 22;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    PlayerSkinConfigTemplate { _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 PlayerSkinConfigTemplateArgs<'args>
  ) -> flatbuffers::WIPOffset<PlayerSkinConfigTemplate<'bldr>> {
    let mut builder = PlayerSkinConfigTemplateBuilder::new(_fbb);
    if let Some(x) = args.unk_9 { builder.add_unk_9(x); }
    if let Some(x) = args.unk_8 { builder.add_unk_8(x); }
    builder.add_unk_7(args.unk_7);
    builder.add_unk_6(args.unk_6);
    builder.add_unk_5(args.unk_5);
    if let Some(x) = args.unk_4 { builder.add_unk_4(x); }
    builder.add_unk_3(args.unk_3);
    builder.add_gender(args.gender);
    builder.add_player_skin_id(args.player_skin_id);
    builder.add_needs_unlock(args.needs_unlock);
    builder.finish()
  }


  #[inline]
  pub fn player_skin_id(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(PlayerSkinConfigTemplate::VT_PLAYER_SKIN_ID, 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>(PlayerSkinConfigTemplate::VT_GENDER, Some(0)).unwrap()}
  }
  #[inline]
  pub fn needs_unlock(&self) -> bool {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<bool>(PlayerSkinConfigTemplate::VT_NEEDS_UNLOCK, Some(false)).unwrap()}
  }
  #[inline]
  pub fn unk_3(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(PlayerSkinConfigTemplate::VT_UNK_3, Some(0)).unwrap()}
  }
  #[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>>(PlayerSkinConfigTemplate::VT_UNK_4, None)}
  }
  #[inline]
  pub fn unk_5(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(PlayerSkinConfigTemplate::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>(PlayerSkinConfigTemplate::VT_UNK_6, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_7(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(PlayerSkinConfigTemplate::VT_UNK_7, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_8(&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>>(PlayerSkinConfigTemplate::VT_UNK_8, None)}
  }
  #[inline]
  pub fn unk_9(&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>>(PlayerSkinConfigTemplate::VT_UNK_9, None)}
  }
}

impl flatbuffers::Verifiable for PlayerSkinConfigTemplate<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<u32>("player_skin_id", Self::VT_PLAYER_SKIN_ID, false)?
     .visit_field::<u32>("gender", Self::VT_GENDER, false)?
     .visit_field::<bool>("needs_unlock", Self::VT_NEEDS_UNLOCK, false)?
     .visit_field::<i32>("unk_3", Self::VT_UNK_3, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_4", Self::VT_UNK_4, false)?
     .visit_field::<u32>("unk_5", Self::VT_UNK_5, false)?
     .visit_field::<i32>("unk_6", Self::VT_UNK_6, false)?
     .visit_field::<i32>("unk_7", Self::VT_UNK_7, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_8", Self::VT_UNK_8, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_9", Self::VT_UNK_9, false)?
     .finish();
    Ok(())
  }
}
pub struct PlayerSkinConfigTemplateArgs<'a> {
    pub player_skin_id: u32,
    pub gender: u32,
    pub needs_unlock: bool,
    pub unk_3: i32,
    pub unk_4: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_5: u32,
    pub unk_6: i32,
    pub unk_7: i32,
    pub unk_8: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_9: Option<flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for PlayerSkinConfigTemplateArgs<'a> {
  #[inline]
  fn default() -> Self {
    PlayerSkinConfigTemplateArgs {
      player_skin_id: 0,
      gender: 0,
      needs_unlock: false,
      unk_3: 0,
      unk_4: None,
      unk_5: 0,
      unk_6: 0,
      unk_7: 0,
      unk_8: None,
      unk_9: None,
    }
  }
}

pub struct PlayerSkinConfigTemplateBuilder<'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> PlayerSkinConfigTemplateBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_player_skin_id(&mut self, player_skin_id: u32) {
    self.fbb_.push_slot::<u32>(PlayerSkinConfigTemplate::VT_PLAYER_SKIN_ID, player_skin_id, 0);
  }
  #[inline]
  pub fn add_gender(&mut self, gender: u32) {
    self.fbb_.push_slot::<u32>(PlayerSkinConfigTemplate::VT_GENDER, gender, 0);
  }
  #[inline]
  pub fn add_needs_unlock(&mut self, needs_unlock: bool) {
    self.fbb_.push_slot::<bool>(PlayerSkinConfigTemplate::VT_NEEDS_UNLOCK, needs_unlock, false);
  }
  #[inline]
  pub fn add_unk_3(&mut self, unk_3: i32) {
    self.fbb_.push_slot::<i32>(PlayerSkinConfigTemplate::VT_UNK_3, unk_3, 0);
  }
  #[inline]
  pub fn add_unk_4(&mut self, unk_4: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(PlayerSkinConfigTemplate::VT_UNK_4, unk_4);
  }
  #[inline]
  pub fn add_unk_5(&mut self, unk_5: u32) {
    self.fbb_.push_slot::<u32>(PlayerSkinConfigTemplate::VT_UNK_5, unk_5, 0);
  }
  #[inline]
  pub fn add_unk_6(&mut self, unk_6: i32) {
    self.fbb_.push_slot::<i32>(PlayerSkinConfigTemplate::VT_UNK_6, unk_6, 0);
  }
  #[inline]
  pub fn add_unk_7(&mut self, unk_7: i32) {
    self.fbb_.push_slot::<i32>(PlayerSkinConfigTemplate::VT_UNK_7, unk_7, 0);
  }
  #[inline]
  pub fn add_unk_8(&mut self, unk_8: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(PlayerSkinConfigTemplate::VT_UNK_8, unk_8);
  }
  #[inline]
  pub fn add_unk_9(&mut self, unk_9: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(PlayerSkinConfigTemplate::VT_UNK_9, unk_9);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> PlayerSkinConfigTemplateBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    PlayerSkinConfigTemplateBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<PlayerSkinConfigTemplate<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for PlayerSkinConfigTemplate<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("PlayerSkinConfigTemplate");
      ds.field("player_skin_id", &self.player_skin_id());
      ds.field("gender", &self.gender());
      ds.field("needs_unlock", &self.needs_unlock());
      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.field("unk_8", &self.unk_8());
      ds.field("unk_9", &self.unk_9());
      ds.finish()
  }
}
pub enum PlayerSkinConfigTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

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

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

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

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

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