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

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

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

impl<'a> PostGirlConfigTemplate<'a> {
  pub const VT_ID: flatbuffers::VOffsetT = 4;
  pub const VT_NAME: flatbuffers::VOffsetT = 6;
  pub const VT_TAG: 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_ROLE_ICON_NAME: flatbuffers::VOffsetT = 16;
  pub const VT_UNK_4: flatbuffers::VOffsetT = 18;
  pub const VT_UNK_5: flatbuffers::VOffsetT = 20;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    PostGirlConfigTemplate { _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 PostGirlConfigTemplateArgs<'args>
  ) -> flatbuffers::WIPOffset<PostGirlConfigTemplate<'bldr>> {
    let mut builder = PostGirlConfigTemplateBuilder::new(_fbb);
    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.role_icon_name { builder.add_role_icon_name(x); }
    builder.add_unk_3(args.unk_3);
    if let Some(x) = args.unk_2 { builder.add_unk_2(x); }
    builder.add_unk_1(args.unk_1);
    if let Some(x) = args.tag { builder.add_tag(x); }
    if let Some(x) = args.name { builder.add_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>(PostGirlConfigTemplate::VT_ID, Some(0)).unwrap()}
  }
  #[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>>(PostGirlConfigTemplate::VT_NAME, None)}
  }
  #[inline]
  pub fn tag(&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>>(PostGirlConfigTemplate::VT_TAG, 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>(PostGirlConfigTemplate::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>>(PostGirlConfigTemplate::VT_UNK_2, None)}
  }
  #[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>(PostGirlConfigTemplate::VT_UNK_3, Some(0)).unwrap()}
  }
  #[inline]
  pub fn role_icon_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>>(PostGirlConfigTemplate::VT_ROLE_ICON_NAME, 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>>(PostGirlConfigTemplate::VT_UNK_4, None)}
  }
  #[inline]
  pub fn unk_5(&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>>>(PostGirlConfigTemplate::VT_UNK_5, None)}
  }
}

impl flatbuffers::Verifiable for PostGirlConfigTemplate<'_> {
  #[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>>("name", Self::VT_NAME, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("tag", Self::VT_TAG, 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::<i32>("unk_3", Self::VT_UNK_3, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("role_icon_name", Self::VT_ROLE_ICON_NAME, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_4", Self::VT_UNK_4, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_5", Self::VT_UNK_5, false)?
     .finish();
    Ok(())
  }
}
pub struct PostGirlConfigTemplateArgs<'a> {
    pub id: u32,
    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
    pub tag: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_1: i32,
    pub unk_2: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_3: i32,
    pub role_icon_name: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_4: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_5: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
}
impl<'a> Default for PostGirlConfigTemplateArgs<'a> {
  #[inline]
  fn default() -> Self {
    PostGirlConfigTemplateArgs {
      id: 0,
      name: None,
      tag: None,
      unk_1: 0,
      unk_2: None,
      unk_3: 0,
      role_icon_name: None,
      unk_4: None,
      unk_5: None,
    }
  }
}

pub struct PostGirlConfigTemplateBuilder<'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> PostGirlConfigTemplateBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_id(&mut self, id: u32) {
    self.fbb_.push_slot::<u32>(PostGirlConfigTemplate::VT_ID, id, 0);
  }
  #[inline]
  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(PostGirlConfigTemplate::VT_NAME, name);
  }
  #[inline]
  pub fn add_tag(&mut self, tag: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(PostGirlConfigTemplate::VT_TAG, tag);
  }
  #[inline]
  pub fn add_unk_1(&mut self, unk_1: i32) {
    self.fbb_.push_slot::<i32>(PostGirlConfigTemplate::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<_>>(PostGirlConfigTemplate::VT_UNK_2, unk_2);
  }
  #[inline]
  pub fn add_unk_3(&mut self, unk_3: i32) {
    self.fbb_.push_slot::<i32>(PostGirlConfigTemplate::VT_UNK_3, unk_3, 0);
  }
  #[inline]
  pub fn add_role_icon_name(&mut self, role_icon_name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(PostGirlConfigTemplate::VT_ROLE_ICON_NAME, role_icon_name);
  }
  #[inline]
  pub fn add_unk_4(&mut self, unk_4: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(PostGirlConfigTemplate::VT_UNK_4, unk_4);
  }
  #[inline]
  pub fn add_unk_5(&mut self, unk_5: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(PostGirlConfigTemplate::VT_UNK_5, unk_5);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> PostGirlConfigTemplateBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    PostGirlConfigTemplateBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<PostGirlConfigTemplate<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for PostGirlConfigTemplate<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("PostGirlConfigTemplate");
      ds.field("id", &self.id());
      ds.field("name", &self.name());
      ds.field("tag", &self.tag());
      ds.field("unk_1", &self.unk_1());
      ds.field("unk_2", &self.unk_2());
      ds.field("unk_3", &self.unk_3());
      ds.field("role_icon_name", &self.role_icon_name());
      ds.field("unk_4", &self.unk_4());
      ds.field("unk_5", &self.unk_5());
      ds.finish()
  }
}
pub enum PostGirlConfigTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

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

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

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

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

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