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

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

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

impl<'a> TeleportConfigTemplate<'a> {
  pub const VT_TELEPORT_ID: flatbuffers::VOffsetT = 4;
  pub const VT_UNK_1: flatbuffers::VOffsetT = 6;
  pub const VT_CLIENT_VISIBLE: flatbuffers::VOffsetT = 8;
  pub const VT_UNLOCK_CONDITION: flatbuffers::VOffsetT = 10;
  pub const VT_TELEPORT_NAME: flatbuffers::VOffsetT = 12;
  pub const VT_TELEPORT_ICON: flatbuffers::VOffsetT = 14;
  pub const VT_UNK_2: flatbuffers::VOffsetT = 16;
  pub const VT_SECTION_ID: flatbuffers::VOffsetT = 18;
  pub const VT_TRANSFORM_ID: flatbuffers::VOffsetT = 20;
  pub const VT_UNK_3: flatbuffers::VOffsetT = 22;
  pub const VT_UNK_4: flatbuffers::VOffsetT = 24;
  pub const VT_UNK_5: flatbuffers::VOffsetT = 26;
  pub const VT_UNK_6: flatbuffers::VOffsetT = 28;
  pub const VT_UNK_7: flatbuffers::VOffsetT = 30;
  pub const VT_UNK_8: flatbuffers::VOffsetT = 32;
  pub const VT_UNK_9: flatbuffers::VOffsetT = 34;
  pub const VT_UNK_10: flatbuffers::VOffsetT = 36;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    TeleportConfigTemplate { _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 TeleportConfigTemplateArgs<'args>
  ) -> flatbuffers::WIPOffset<TeleportConfigTemplate<'bldr>> {
    let mut builder = TeleportConfigTemplateBuilder::new(_fbb);
    builder.add_unk_10(args.unk_10);
    if let Some(x) = args.unk_9 { builder.add_unk_9(x); }
    builder.add_unk_8(args.unk_8);
    builder.add_unk_7(args.unk_7);
    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); }
    builder.add_transform_id(args.transform_id);
    builder.add_section_id(args.section_id);
    builder.add_unk_2(args.unk_2);
    if let Some(x) = args.teleport_icon { builder.add_teleport_icon(x); }
    if let Some(x) = args.teleport_name { builder.add_teleport_name(x); }
    if let Some(x) = args.unlock_condition { builder.add_unlock_condition(x); }
    builder.add_client_visible(args.client_visible);
    builder.add_unk_1(args.unk_1);
    builder.add_teleport_id(args.teleport_id);
    builder.finish()
  }


  #[inline]
  pub fn teleport_id(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_TELEPORT_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>(TeleportConfigTemplate::VT_UNK_1, Some(0)).unwrap()}
  }
  #[inline]
  pub fn client_visible(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_CLIENT_VISIBLE, Some(0)).unwrap()}
  }
  #[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>>(TeleportConfigTemplate::VT_UNLOCK_CONDITION, None)}
  }
  #[inline]
  pub fn teleport_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>>(TeleportConfigTemplate::VT_TELEPORT_NAME, None)}
  }
  #[inline]
  pub fn teleport_icon(&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>>(TeleportConfigTemplate::VT_TELEPORT_ICON, None)}
  }
  #[inline]
  pub fn unk_2(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_UNK_2, Some(0)).unwrap()}
  }
  #[inline]
  pub fn section_id(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_SECTION_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn transform_id(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_TRANSFORM_ID, Some(0)).unwrap()}
  }
  #[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>>(TeleportConfigTemplate::VT_UNK_3, None)}
  }
  #[inline]
  pub fn unk_4(&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>>>(TeleportConfigTemplate::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>>>(TeleportConfigTemplate::VT_UNK_5, None)}
  }
  #[inline]
  pub fn unk_6(&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>>>(TeleportConfigTemplate::VT_UNK_6, None)}
  }
  #[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>(TeleportConfigTemplate::VT_UNK_7, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_8(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_UNK_8, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_9(&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>>>(TeleportConfigTemplate::VT_UNK_9, None)}
  }
  #[inline]
  pub fn unk_10(&self) -> i32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<i32>(TeleportConfigTemplate::VT_UNK_10, Some(0)).unwrap()}
  }
}

impl flatbuffers::Verifiable for TeleportConfigTemplate<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<i32>("teleport_id", Self::VT_TELEPORT_ID, false)?
     .visit_field::<i32>("unk_1", Self::VT_UNK_1, false)?
     .visit_field::<i32>("client_visible", Self::VT_CLIENT_VISIBLE, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unlock_condition", Self::VT_UNLOCK_CONDITION, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("teleport_name", Self::VT_TELEPORT_NAME, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("teleport_icon", Self::VT_TELEPORT_ICON, false)?
     .visit_field::<i32>("unk_2", Self::VT_UNK_2, false)?
     .visit_field::<i32>("section_id", Self::VT_SECTION_ID, false)?
     .visit_field::<i32>("transform_id", Self::VT_TRANSFORM_ID, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("unk_3", Self::VT_UNK_3, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_4", Self::VT_UNK_4, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_5", Self::VT_UNK_5, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_6", Self::VT_UNK_6, false)?
     .visit_field::<i32>("unk_7", Self::VT_UNK_7, false)?
     .visit_field::<i32>("unk_8", Self::VT_UNK_8, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("unk_9", Self::VT_UNK_9, false)?
     .visit_field::<i32>("unk_10", Self::VT_UNK_10, false)?
     .finish();
    Ok(())
  }
}
pub struct TeleportConfigTemplateArgs<'a> {
    pub teleport_id: i32,
    pub unk_1: i32,
    pub client_visible: i32,
    pub unlock_condition: Option<flatbuffers::WIPOffset<&'a str>>,
    pub teleport_name: Option<flatbuffers::WIPOffset<&'a str>>,
    pub teleport_icon: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_2: i32,
    pub section_id: i32,
    pub transform_id: i32,
    pub unk_3: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_4: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
    pub unk_5: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
    pub unk_6: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
    pub unk_7: i32,
    pub unk_8: i32,
    pub unk_9: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
    pub unk_10: i32,
}
impl<'a> Default for TeleportConfigTemplateArgs<'a> {
  #[inline]
  fn default() -> Self {
    TeleportConfigTemplateArgs {
      teleport_id: 0,
      unk_1: 0,
      client_visible: 0,
      unlock_condition: None,
      teleport_name: None,
      teleport_icon: None,
      unk_2: 0,
      section_id: 0,
      transform_id: 0,
      unk_3: None,
      unk_4: None,
      unk_5: None,
      unk_6: None,
      unk_7: 0,
      unk_8: 0,
      unk_9: None,
      unk_10: 0,
    }
  }
}

pub struct TeleportConfigTemplateBuilder<'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> TeleportConfigTemplateBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_teleport_id(&mut self, teleport_id: i32) {
    self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_TELEPORT_ID, teleport_id, 0);
  }
  #[inline]
  pub fn add_unk_1(&mut self, unk_1: i32) {
    self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_1, unk_1, 0);
  }
  #[inline]
  pub fn add_client_visible(&mut self, client_visible: i32) {
    self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_CLIENT_VISIBLE, client_visible, 0);
  }
  #[inline]
  pub fn add_unlock_condition(&mut self, unlock_condition: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNLOCK_CONDITION, unlock_condition);
  }
  #[inline]
  pub fn add_teleport_name(&mut self, teleport_name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_TELEPORT_NAME, teleport_name);
  }
  #[inline]
  pub fn add_teleport_icon(&mut self, teleport_icon: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_TELEPORT_ICON, teleport_icon);
  }
  #[inline]
  pub fn add_unk_2(&mut self, unk_2: i32) {
    self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_2, unk_2, 0);
  }
  #[inline]
  pub fn add_section_id(&mut self, section_id: i32) {
    self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_SECTION_ID, section_id, 0);
  }
  #[inline]
  pub fn add_transform_id(&mut self, transform_id: i32) {
    self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_TRANSFORM_ID, transform_id, 0);
  }
  #[inline]
  pub fn add_unk_3(&mut self, unk_3: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNK_3, unk_3);
  }
  #[inline]
  pub fn add_unk_4(&mut self, unk_4: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::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<_>>(TeleportConfigTemplate::VT_UNK_5, unk_5);
  }
  #[inline]
  pub fn add_unk_6(&mut self, unk_6: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNK_6, unk_6);
  }
  #[inline]
  pub fn add_unk_7(&mut self, unk_7: i32) {
    self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_7, unk_7, 0);
  }
  #[inline]
  pub fn add_unk_8(&mut self, unk_8: i32) {
    self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_8, unk_8, 0);
  }
  #[inline]
  pub fn add_unk_9(&mut self, unk_9: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(TeleportConfigTemplate::VT_UNK_9, unk_9);
  }
  #[inline]
  pub fn add_unk_10(&mut self, unk_10: i32) {
    self.fbb_.push_slot::<i32>(TeleportConfigTemplate::VT_UNK_10, unk_10, 0);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> TeleportConfigTemplateBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    TeleportConfigTemplateBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<TeleportConfigTemplate<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for TeleportConfigTemplate<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("TeleportConfigTemplate");
      ds.field("teleport_id", &self.teleport_id());
      ds.field("unk_1", &self.unk_1());
      ds.field("client_visible", &self.client_visible());
      ds.field("unlock_condition", &self.unlock_condition());
      ds.field("teleport_name", &self.teleport_name());
      ds.field("teleport_icon", &self.teleport_icon());
      ds.field("unk_2", &self.unk_2());
      ds.field("section_id", &self.section_id());
      ds.field("transform_id", &self.transform_id());
      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.field("unk_10", &self.unk_10());
      ds.finish()
  }
}
pub enum TeleportConfigTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

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

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

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

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

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