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

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

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

impl<'a> HollowConfigTemplate<'a> {
  pub const VT_ID: flatbuffers::VOffsetT = 4;
  pub const VT_HOLLOW_GROUP: flatbuffers::VOffsetT = 6;
  pub const VT_NAME: flatbuffers::VOffsetT = 8;
  pub const VT_UNLOCK_CONDITION: flatbuffers::VOffsetT = 10;
  pub const VT_LOCK_HINT: flatbuffers::VOffsetT = 12;
  pub const VT_PIC_RES: flatbuffers::VOffsetT = 14;
  pub const VT_MODEL_RES: flatbuffers::VOffsetT = 16;
  pub const VT_LOCKED_COLOR: flatbuffers::VOffsetT = 18;
  pub const VT_UNLOCKED_COLOR: flatbuffers::VOffsetT = 20;
  pub const VT_UNK_1: flatbuffers::VOffsetT = 22;
  pub const VT_UNK_2: flatbuffers::VOffsetT = 24;
  pub const VT_UNK_3: flatbuffers::VOffsetT = 26;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    HollowConfigTemplate { _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 HollowConfigTemplateArgs<'args>
  ) -> flatbuffers::WIPOffset<HollowConfigTemplate<'bldr>> {
    let mut builder = HollowConfigTemplateBuilder::new(_fbb);
    if let Some(x) = args.unk_3 { builder.add_unk_3(x); }
    if let Some(x) = args.unk_2 { builder.add_unk_2(x); }
    if let Some(x) = args.unlocked_color { builder.add_unlocked_color(x); }
    if let Some(x) = args.locked_color { builder.add_locked_color(x); }
    if let Some(x) = args.model_res { builder.add_model_res(x); }
    if let Some(x) = args.pic_res { builder.add_pic_res(x); }
    if let Some(x) = args.lock_hint { builder.add_lock_hint(x); }
    if let Some(x) = args.unlock_condition { builder.add_unlock_condition(x); }
    if let Some(x) = args.name { builder.add_name(x); }
    builder.add_hollow_group(args.hollow_group);
    builder.add_id(args.id);
    builder.add_unk_1(args.unk_1);
    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>(HollowConfigTemplate::VT_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn hollow_group(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(HollowConfigTemplate::VT_HOLLOW_GROUP, 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>>(HollowConfigTemplate::VT_NAME, None)}
  }
  #[inline]
  pub fn unlock_condition(&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>>(HollowConfigTemplate::VT_UNLOCK_CONDITION, None)}
  }
  #[inline]
  pub fn lock_hint(&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>>(HollowConfigTemplate::VT_LOCK_HINT, None)}
  }
  #[inline]
  pub fn pic_res(&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>>(HollowConfigTemplate::VT_PIC_RES, None)}
  }
  #[inline]
  pub fn model_res(&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>>(HollowConfigTemplate::VT_MODEL_RES, None)}
  }
  #[inline]
  pub fn locked_color(&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>>(HollowConfigTemplate::VT_LOCKED_COLOR, None)}
  }
  #[inline]
  pub fn unlocked_color(&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>>(HollowConfigTemplate::VT_UNLOCKED_COLOR, None)}
  }
  #[inline]
  pub fn unk_1(&self) -> bool {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<bool>(HollowConfigTemplate::VT_UNK_1, Some(false)).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>>(HollowConfigTemplate::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>>(HollowConfigTemplate::VT_UNK_3, None)}
  }
}

impl flatbuffers::Verifiable for HollowConfigTemplate<'_> {
  #[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::<u32>("hollow_group", Self::VT_HOLLOW_GROUP, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unlock_condition", Self::VT_UNLOCK_CONDITION, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("lock_hint", Self::VT_LOCK_HINT, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("pic_res", Self::VT_PIC_RES, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("model_res", Self::VT_MODEL_RES, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("locked_color", Self::VT_LOCKED_COLOR, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unlocked_color", Self::VT_UNLOCKED_COLOR, false)?
     .visit_field::<bool>("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)?
     .finish();
    Ok(())
  }
}
pub struct HollowConfigTemplateArgs<'a> {
    pub id: u32,
    pub hollow_group: u32,
    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unlock_condition: Option<flatbuffers::WIPOffset<&'a str>>,
    pub lock_hint: Option<flatbuffers::WIPOffset<&'a str>>,
    pub pic_res: Option<flatbuffers::WIPOffset<&'a str>>,
    pub model_res: Option<flatbuffers::WIPOffset<&'a str>>,
    pub locked_color: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unlocked_color: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_1: bool,
    pub unk_2: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_3: Option<flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for HollowConfigTemplateArgs<'a> {
  #[inline]
  fn default() -> Self {
    HollowConfigTemplateArgs {
      id: 0,
      hollow_group: 0,
      name: None,
      unlock_condition: None,
      lock_hint: None,
      pic_res: None,
      model_res: None,
      locked_color: None,
      unlocked_color: None,
      unk_1: false,
      unk_2: None,
      unk_3: None,
    }
  }
}

pub struct HollowConfigTemplateBuilder<'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> HollowConfigTemplateBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_id(&mut self, id: u32) {
    self.fbb_.push_slot::<u32>(HollowConfigTemplate::VT_ID, id, 0);
  }
  #[inline]
  pub fn add_hollow_group(&mut self, hollow_group: u32) {
    self.fbb_.push_slot::<u32>(HollowConfigTemplate::VT_HOLLOW_GROUP, hollow_group, 0);
  }
  #[inline]
  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(HollowConfigTemplate::VT_NAME, name);
  }
  #[inline]
  pub fn add_unlock_condition(&mut self, unlock_condition: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(HollowConfigTemplate::VT_UNLOCK_CONDITION, unlock_condition);
  }
  #[inline]
  pub fn add_lock_hint(&mut self, lock_hint: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(HollowConfigTemplate::VT_LOCK_HINT, lock_hint);
  }
  #[inline]
  pub fn add_pic_res(&mut self, pic_res: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(HollowConfigTemplate::VT_PIC_RES, pic_res);
  }
  #[inline]
  pub fn add_model_res(&mut self, model_res: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(HollowConfigTemplate::VT_MODEL_RES, model_res);
  }
  #[inline]
  pub fn add_locked_color(&mut self, locked_color: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(HollowConfigTemplate::VT_LOCKED_COLOR, locked_color);
  }
  #[inline]
  pub fn add_unlocked_color(&mut self, unlocked_color: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(HollowConfigTemplate::VT_UNLOCKED_COLOR, unlocked_color);
  }
  #[inline]
  pub fn add_unk_1(&mut self, unk_1: bool) {
    self.fbb_.push_slot::<bool>(HollowConfigTemplate::VT_UNK_1, unk_1, false);
  }
  #[inline]
  pub fn add_unk_2(&mut self, unk_2: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(HollowConfigTemplate::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<_>>(HollowConfigTemplate::VT_UNK_3, unk_3);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> HollowConfigTemplateBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    HollowConfigTemplateBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<HollowConfigTemplate<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for HollowConfigTemplate<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("HollowConfigTemplate");
      ds.field("id", &self.id());
      ds.field("hollow_group", &self.hollow_group());
      ds.field("name", &self.name());
      ds.field("unlock_condition", &self.unlock_condition());
      ds.field("lock_hint", &self.lock_hint());
      ds.field("pic_res", &self.pic_res());
      ds.field("model_res", &self.model_res());
      ds.field("locked_color", &self.locked_color());
      ds.field("unlocked_color", &self.unlocked_color());
      ds.field("unk_1", &self.unk_1());
      ds.field("unk_2", &self.unk_2());
      ds.field("unk_3", &self.unk_3());
      ds.finish()
  }
}
pub enum HollowConfigTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

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

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

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

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

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