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

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

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

impl<'a> BigSceneMapAreaTemplate<'a> {
  pub const VT_AREA_ID: flatbuffers::VOffsetT = 4;
  pub const VT_UNK_1: flatbuffers::VOffsetT = 6;
  pub const VT_UNK_2: flatbuffers::VOffsetT = 8;
  pub const VT_UNK_3: flatbuffers::VOffsetT = 10;
  pub const VT_GROUP_ID: flatbuffers::VOffsetT = 12;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    BigSceneMapAreaTemplate { _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 BigSceneMapAreaTemplateArgs<'args>
  ) -> flatbuffers::WIPOffset<BigSceneMapAreaTemplate<'bldr>> {
    let mut builder = BigSceneMapAreaTemplateBuilder::new(_fbb);
    builder.add_group_id(args.group_id);
    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.unk_1 { builder.add_unk_1(x); }
    builder.add_area_id(args.area_id);
    builder.finish()
  }


  #[inline]
  pub fn area_id(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(BigSceneMapAreaTemplate::VT_AREA_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_1(&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>>(BigSceneMapAreaTemplate::VT_UNK_1, None)}
  }
  #[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>>(BigSceneMapAreaTemplate::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>>(BigSceneMapAreaTemplate::VT_UNK_3, None)}
  }
  #[inline]
  pub fn group_id(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(BigSceneMapAreaTemplate::VT_GROUP_ID, Some(0)).unwrap()}
  }
}

impl flatbuffers::Verifiable for BigSceneMapAreaTemplate<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<u32>("area_id", Self::VT_AREA_ID, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("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)?
     .visit_field::<u32>("group_id", Self::VT_GROUP_ID, false)?
     .finish();
    Ok(())
  }
}
pub struct BigSceneMapAreaTemplateArgs<'a> {
    pub area_id: u32,
    pub unk_1: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_2: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_3: Option<flatbuffers::WIPOffset<&'a str>>,
    pub group_id: u32,
}
impl<'a> Default for BigSceneMapAreaTemplateArgs<'a> {
  #[inline]
  fn default() -> Self {
    BigSceneMapAreaTemplateArgs {
      area_id: 0,
      unk_1: None,
      unk_2: None,
      unk_3: None,
      group_id: 0,
    }
  }
}

pub struct BigSceneMapAreaTemplateBuilder<'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> BigSceneMapAreaTemplateBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_area_id(&mut self, area_id: u32) {
    self.fbb_.push_slot::<u32>(BigSceneMapAreaTemplate::VT_AREA_ID, area_id, 0);
  }
  #[inline]
  pub fn add_unk_1(&mut self, unk_1: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(BigSceneMapAreaTemplate::VT_UNK_1, unk_1);
  }
  #[inline]
  pub fn add_unk_2(&mut self, unk_2: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(BigSceneMapAreaTemplate::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<_>>(BigSceneMapAreaTemplate::VT_UNK_3, unk_3);
  }
  #[inline]
  pub fn add_group_id(&mut self, group_id: u32) {
    self.fbb_.push_slot::<u32>(BigSceneMapAreaTemplate::VT_GROUP_ID, group_id, 0);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> BigSceneMapAreaTemplateBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    BigSceneMapAreaTemplateBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<BigSceneMapAreaTemplate<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for BigSceneMapAreaTemplate<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("BigSceneMapAreaTemplate");
      ds.field("area_id", &self.area_id());
      ds.field("unk_1", &self.unk_1());
      ds.field("unk_2", &self.unk_2());
      ds.field("unk_3", &self.unk_3());
      ds.field("group_id", &self.group_id());
      ds.finish()
  }
}
pub enum BigSceneMapAreaTemplateTbOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

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

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

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

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

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