// automatically generated by the FlatBuffers compiler, do not modify
// @generated
extern crate alloc;
extern crate serde;
use self::serde::ser::{Serialize, Serializer, SerializeStruct};
use super::*;
pub enum MonsterOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

impl<'a> Monster<'a> {

  pub const fn get_fully_qualified_name() -> &'static str {
    "MyGame.Example2.Monster"
  }

  #[inline]
  pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
    Monster { _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 MonsterArgs
  ) -> ::flatbuffers::WIPOffset<Monster<'bldr>> {
    let mut builder = MonsterBuilder::new(_fbb);
    builder.finish()
  }

  pub fn unpack(&self) -> MonsterT {
    MonsterT {
    }
  }
}

impl ::flatbuffers::Verifiable for Monster<'_> {
  #[inline]
  fn run_verifier(
    v: &mut ::flatbuffers::Verifier, pos: usize
  ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
    v.visit_table(pos)?
     .finish();
    Ok(())
  }
}
pub struct MonsterArgs {
}
impl<'a> Default for MonsterArgs {
  #[inline]
  fn default() -> Self {
    MonsterArgs {
    }
  }
}

impl Serialize for Monster<'_> {
  fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
  where
    S: Serializer,
  {
    let s = serializer.serialize_struct("Monster", 0)?;
    s.end()
  }
}

pub struct MonsterBuilder<'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> MonsterBuilder<'a, 'b, A> {
  #[inline]
  pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> MonsterBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    MonsterBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> ::flatbuffers::WIPOffset<Monster<'a>> {
    let o = self.fbb_.end_table(self.start_);
    ::flatbuffers::WIPOffset::new(o.value())
  }
}

impl ::core::fmt::Debug for Monster<'_> {
  fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
    let mut ds = f.debug_struct("Monster");
      ds.finish()
  }
}
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
pub struct MonsterT {
}
impl Default for MonsterT {
  fn default() -> Self {
    Self {
    }
  }
}
impl MonsterT {
  pub fn pack<'b, A: ::flatbuffers::Allocator + 'b>(
    &self,
    _fbb: &mut ::flatbuffers::FlatBufferBuilder<'b, A>
  ) -> ::flatbuffers::WIPOffset<Monster<'b>> {
    Monster::create(_fbb, &MonsterArgs{
    })
  }
}
