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

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

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

impl<'a> UrbanAreaMapGroupTemplate<'a> {
  pub const VT_AREA_GROUP_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_UNK_4: flatbuffers::VOffsetT = 12;
  pub const VT_GROUP_NAME: flatbuffers::VOffsetT = 14;
  pub const VT_UNK_6: flatbuffers::VOffsetT = 16;
  pub const VT_IS_MAP_VISIBLE: flatbuffers::VOffsetT = 18;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    UrbanAreaMapGroupTemplate { _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 UrbanAreaMapGroupTemplateArgs<'args>
  ) -> flatbuffers::WIPOffset<UrbanAreaMapGroupTemplate<'bldr>> {
    let mut builder = UrbanAreaMapGroupTemplateBuilder::new(_fbb);
    if let Some(x) = args.group_name { builder.add_group_name(x); }
    if let Some(x) = args.unk_4 { builder.add_unk_4(x); }
    builder.add_unk_3(args.unk_3);
    builder.add_unk_2(args.unk_2);
    if let Some(x) = args.unk_1 { builder.add_unk_1(x); }
    builder.add_area_group_id(args.area_group_id);
    builder.add_is_map_visible(args.is_map_visible);
    builder.add_unk_6(args.unk_6);
    builder.finish()
  }


  #[inline]
  pub fn area_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>(UrbanAreaMapGroupTemplate::VT_AREA_GROUP_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn unk_1(&self) -> Option<flatbuffers::Vector<'a, bool>> {
    // 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, bool>>>(UrbanAreaMapGroupTemplate::VT_UNK_1, 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>(UrbanAreaMapGroupTemplate::VT_UNK_2, Some(0)).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>(UrbanAreaMapGroupTemplate::VT_UNK_3, Some(0)).unwrap()}
  }
  #[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>>>(UrbanAreaMapGroupTemplate::VT_UNK_4, None)}
  }
  #[inline]
  pub fn group_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>>(UrbanAreaMapGroupTemplate::VT_GROUP_NAME, None)}
  }
  #[inline]
  pub fn unk_6(&self) -> bool {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<bool>(UrbanAreaMapGroupTemplate::VT_UNK_6, Some(false)).unwrap()}
  }
  #[inline]
  pub fn is_map_visible(&self) -> bool {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<bool>(UrbanAreaMapGroupTemplate::VT_IS_MAP_VISIBLE, Some(false)).unwrap()}
  }
}

impl flatbuffers::Verifiable for UrbanAreaMapGroupTemplate<'_> {
  #[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_group_id", Self::VT_AREA_GROUP_ID, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, bool>>>("unk_1", Self::VT_UNK_1, false)?
     .visit_field::<i32>("unk_2", Self::VT_UNK_2, false)?
     .visit_field::<i32>("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<&str>>("group_name", Self::VT_GROUP_NAME, false)?
     .visit_field::<bool>("unk_6", Self::VT_UNK_6, false)?
     .visit_field::<bool>("is_map_visible", Self::VT_IS_MAP_VISIBLE, false)?
     .finish();
    Ok(())
  }
}
pub struct UrbanAreaMapGroupTemplateArgs<'a> {
    pub area_group_id: u32,
    pub unk_1: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, bool>>>,
    pub unk_2: i32,
    pub unk_3: i32,
    pub unk_4: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
    pub group_name: Option<flatbuffers::WIPOffset<&'a str>>,
    pub unk_6: bool,
    pub is_map_visible: bool,
}
impl<'a> Default for UrbanAreaMapGroupTemplateArgs<'a> {
  #[inline]
  fn default() -> Self {
    UrbanAreaMapGroupTemplateArgs {
      area_group_id: 0,
      unk_1: None,
      unk_2: 0,
      unk_3: 0,
      unk_4: None,
      group_name: None,
      unk_6: false,
      is_map_visible: false,
    }
  }
}

pub struct UrbanAreaMapGroupTemplateBuilder<'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> UrbanAreaMapGroupTemplateBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_area_group_id(&mut self, area_group_id: u32) {
    self.fbb_.push_slot::<u32>(UrbanAreaMapGroupTemplate::VT_AREA_GROUP_ID, area_group_id, 0);
  }
  #[inline]
  pub fn add_unk_1(&mut self, unk_1: flatbuffers::WIPOffset<flatbuffers::Vector<'b , bool>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapGroupTemplate::VT_UNK_1, unk_1);
  }
  #[inline]
  pub fn add_unk_2(&mut self, unk_2: i32) {
    self.fbb_.push_slot::<i32>(UrbanAreaMapGroupTemplate::VT_UNK_2, unk_2, 0);
  }
  #[inline]
  pub fn add_unk_3(&mut self, unk_3: i32) {
    self.fbb_.push_slot::<i32>(UrbanAreaMapGroupTemplate::VT_UNK_3, unk_3, 0);
  }
  #[inline]
  pub fn add_unk_4(&mut self, unk_4: flatbuffers::WIPOffset<flatbuffers::Vector<'b , i32>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapGroupTemplate::VT_UNK_4, unk_4);
  }
  #[inline]
  pub fn add_group_name(&mut self, group_name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(UrbanAreaMapGroupTemplate::VT_GROUP_NAME, group_name);
  }
  #[inline]
  pub fn add_unk_6(&mut self, unk_6: bool) {
    self.fbb_.push_slot::<bool>(UrbanAreaMapGroupTemplate::VT_UNK_6, unk_6, false);
  }
  #[inline]
  pub fn add_is_map_visible(&mut self, is_map_visible: bool) {
    self.fbb_.push_slot::<bool>(UrbanAreaMapGroupTemplate::VT_IS_MAP_VISIBLE, is_map_visible, false);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> UrbanAreaMapGroupTemplateBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    UrbanAreaMapGroupTemplateBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<UrbanAreaMapGroupTemplate<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

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

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

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

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

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

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

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

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