// 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 AvatarBaseTemplateOffset {} #[derive(Copy, Clone, PartialEq)] pub struct AvatarBaseTemplate<'a> { pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for AvatarBaseTemplate<'a> { type Inner = AvatarBaseTemplate<'a>; #[inline] unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { Self { _tab: flatbuffers::Table::new(buf, loc) } } } impl<'a> AvatarBaseTemplate<'a> { pub const VT_ID: flatbuffers::VOffsetT = 4; pub const VT_CODE_NAME: flatbuffers::VOffsetT = 6; pub const VT_NAME: flatbuffers::VOffsetT = 8; pub const VT_FULL_NAME: flatbuffers::VOffsetT = 10; pub const VT_AUDIO_EVENT_REPLACE_PARAM: flatbuffers::VOffsetT = 12; pub const VT_AUDIO_BANK: flatbuffers::VOffsetT = 14; pub const VT_HIT_TYPES: flatbuffers::VOffsetT = 16; pub const VT_ELEMENT_TYPES: flatbuffers::VOffsetT = 18; pub const VT_UNK_1: flatbuffers::VOffsetT = 20; pub const VT_GENDER: flatbuffers::VOffsetT = 22; pub const VT_CAMP: flatbuffers::VOffsetT = 24; pub const VT_UNK_2: flatbuffers::VOffsetT = 26; #[inline] pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { AvatarBaseTemplate { _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 AvatarBaseTemplateArgs<'args> ) -> flatbuffers::WIPOffset> { let mut builder = AvatarBaseTemplateBuilder::new(_fbb); if let Some(x) = args.unk_2 { builder.add_unk_2(x); } builder.add_camp(args.camp); builder.add_gender(args.gender); builder.add_unk_1(args.unk_1); if let Some(x) = args.element_types { builder.add_element_types(x); } if let Some(x) = args.hit_types { builder.add_hit_types(x); } if let Some(x) = args.audio_bank { builder.add_audio_bank(x); } if let Some(x) = args.audio_event_replace_param { builder.add_audio_event_replace_param(x); } if let Some(x) = args.full_name { builder.add_full_name(x); } if let Some(x) = args.name { builder.add_name(x); } if let Some(x) = args.code_name { builder.add_code_name(x); } builder.add_id(args.id); builder.finish() } #[inline] pub fn id(&self) -> i32 { // Safety: // Created from valid Table for this object // which contains a valid value in this slot unsafe { self._tab.get::(AvatarBaseTemplate::VT_ID, Some(0)).unwrap()} } #[inline] pub fn code_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::>(AvatarBaseTemplate::VT_CODE_NAME, None)} } #[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::>(AvatarBaseTemplate::VT_NAME, None)} } #[inline] pub fn full_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::>(AvatarBaseTemplate::VT_FULL_NAME, None)} } #[inline] pub fn audio_event_replace_param(&self) -> Option<&'a str> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot unsafe { self._tab.get::>(AvatarBaseTemplate::VT_AUDIO_EVENT_REPLACE_PARAM, None)} } #[inline] pub fn audio_bank(&self) -> Option<&'a str> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot unsafe { self._tab.get::>(AvatarBaseTemplate::VT_AUDIO_BANK, None)} } #[inline] pub fn hit_types(&self) -> Option> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot unsafe { self._tab.get::>>(AvatarBaseTemplate::VT_HIT_TYPES, None)} } #[inline] pub fn element_types(&self) -> Option> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot unsafe { self._tab.get::>>(AvatarBaseTemplate::VT_ELEMENT_TYPES, None)} } #[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::(AvatarBaseTemplate::VT_UNK_1, Some(0)).unwrap()} } #[inline] pub fn gender(&self) -> i32 { // Safety: // Created from valid Table for this object // which contains a valid value in this slot unsafe { self._tab.get::(AvatarBaseTemplate::VT_GENDER, Some(0)).unwrap()} } #[inline] pub fn camp(&self) -> i32 { // Safety: // Created from valid Table for this object // which contains a valid value in this slot unsafe { self._tab.get::(AvatarBaseTemplate::VT_CAMP, Some(0)).unwrap()} } #[inline] pub fn unk_2(&self) -> Option>> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot unsafe { self._tab.get::>>>(AvatarBaseTemplate::VT_UNK_2, None)} } } impl flatbuffers::Verifiable for AvatarBaseTemplate<'_> { #[inline] fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer> { use self::flatbuffers::Verifiable; v.visit_table(pos)? .visit_field::("id", Self::VT_ID, false)? .visit_field::>("code_name", Self::VT_CODE_NAME, false)? .visit_field::>("name", Self::VT_NAME, false)? .visit_field::>("full_name", Self::VT_FULL_NAME, false)? .visit_field::>("audio_event_replace_param", Self::VT_AUDIO_EVENT_REPLACE_PARAM, false)? .visit_field::>("audio_bank", Self::VT_AUDIO_BANK, false)? .visit_field::>>("hit_types", Self::VT_HIT_TYPES, false)? .visit_field::>>("element_types", Self::VT_ELEMENT_TYPES, false)? .visit_field::("unk_1", Self::VT_UNK_1, false)? .visit_field::("gender", Self::VT_GENDER, false)? .visit_field::("camp", Self::VT_CAMP, false)? .visit_field::>>>("unk_2", Self::VT_UNK_2, false)? .finish(); Ok(()) } } pub struct AvatarBaseTemplateArgs<'a> { pub id: i32, pub code_name: Option>, pub name: Option>, pub full_name: Option>, pub audio_event_replace_param: Option>, pub audio_bank: Option>, pub hit_types: Option>>, pub element_types: Option>>, pub unk_1: i32, pub gender: i32, pub camp: i32, pub unk_2: Option>>>, } impl<'a> Default for AvatarBaseTemplateArgs<'a> { #[inline] fn default() -> Self { AvatarBaseTemplateArgs { id: 0, code_name: None, name: None, full_name: None, audio_event_replace_param: None, audio_bank: None, hit_types: None, element_types: None, unk_1: 0, gender: 0, camp: 0, unk_2: None, } } } pub struct AvatarBaseTemplateBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> { fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> AvatarBaseTemplateBuilder<'a, 'b, A> { #[inline] pub fn add_id(&mut self, id: i32) { self.fbb_.push_slot::(AvatarBaseTemplate::VT_ID, id, 0); } #[inline] pub fn add_code_name(&mut self, code_name: flatbuffers::WIPOffset<&'b str>) { self.fbb_.push_slot_always::>(AvatarBaseTemplate::VT_CODE_NAME, code_name); } #[inline] pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) { self.fbb_.push_slot_always::>(AvatarBaseTemplate::VT_NAME, name); } #[inline] pub fn add_full_name(&mut self, full_name: flatbuffers::WIPOffset<&'b str>) { self.fbb_.push_slot_always::>(AvatarBaseTemplate::VT_FULL_NAME, full_name); } #[inline] pub fn add_audio_event_replace_param(&mut self, audio_event_replace_param: flatbuffers::WIPOffset<&'b str>) { self.fbb_.push_slot_always::>(AvatarBaseTemplate::VT_AUDIO_EVENT_REPLACE_PARAM, audio_event_replace_param); } #[inline] pub fn add_audio_bank(&mut self, audio_bank: flatbuffers::WIPOffset<&'b str>) { self.fbb_.push_slot_always::>(AvatarBaseTemplate::VT_AUDIO_BANK, audio_bank); } #[inline] pub fn add_hit_types(&mut self, hit_types: flatbuffers::WIPOffset>) { self.fbb_.push_slot_always::>(AvatarBaseTemplate::VT_HIT_TYPES, hit_types); } #[inline] pub fn add_element_types(&mut self, element_types: flatbuffers::WIPOffset>) { self.fbb_.push_slot_always::>(AvatarBaseTemplate::VT_ELEMENT_TYPES, element_types); } #[inline] pub fn add_unk_1(&mut self, unk_1: i32) { self.fbb_.push_slot::(AvatarBaseTemplate::VT_UNK_1, unk_1, 0); } #[inline] pub fn add_gender(&mut self, gender: i32) { self.fbb_.push_slot::(AvatarBaseTemplate::VT_GENDER, gender, 0); } #[inline] pub fn add_camp(&mut self, camp: i32) { self.fbb_.push_slot::(AvatarBaseTemplate::VT_CAMP, camp, 0); } #[inline] pub fn add_unk_2(&mut self, unk_2: flatbuffers::WIPOffset>>) { self.fbb_.push_slot_always::>(AvatarBaseTemplate::VT_UNK_2, unk_2); } #[inline] pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> AvatarBaseTemplateBuilder<'a, 'b, A> { let start = _fbb.start_table(); AvatarBaseTemplateBuilder { fbb_: _fbb, start_: start, } } #[inline] pub fn finish(self) -> flatbuffers::WIPOffset> { let o = self.fbb_.end_table(self.start_); flatbuffers::WIPOffset::new(o.value()) } } impl core::fmt::Debug for AvatarBaseTemplate<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { let mut ds = f.debug_struct("AvatarBaseTemplate"); ds.field("id", &self.id()); ds.field("code_name", &self.code_name()); ds.field("name", &self.name()); ds.field("full_name", &self.full_name()); ds.field("audio_event_replace_param", &self.audio_event_replace_param()); ds.field("audio_bank", &self.audio_bank()); ds.field("hit_types", &self.hit_types()); ds.field("element_types", &self.element_types()); ds.field("unk_1", &self.unk_1()); ds.field("gender", &self.gender()); ds.field("camp", &self.camp()); ds.field("unk_2", &self.unk_2()); ds.finish() } } pub enum AvatarBaseTemplateTbOffset {} #[derive(Copy, Clone, PartialEq)] pub struct AvatarBaseTemplateTb<'a> { pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for AvatarBaseTemplateTb<'a> { type Inner = AvatarBaseTemplateTb<'a>; #[inline] unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { Self { _tab: flatbuffers::Table::new(buf, loc) } } } impl<'a> AvatarBaseTemplateTb<'a> { pub const VT_DATA: flatbuffers::VOffsetT = 4; #[inline] pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self { AvatarBaseTemplateTb { _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 AvatarBaseTemplateTbArgs<'args> ) -> flatbuffers::WIPOffset> { let mut builder = AvatarBaseTemplateTbBuilder::new(_fbb); if let Some(x) = args.data { builder.add_data(x); } builder.finish() } #[inline] pub fn data(&self) -> Option>>> { // Safety: // Created from valid Table for this object // which contains a valid value in this slot unsafe { self._tab.get::>>>(AvatarBaseTemplateTb::VT_DATA, None)} } } impl flatbuffers::Verifiable for AvatarBaseTemplateTb<'_> { #[inline] fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer> { use self::flatbuffers::Verifiable; v.visit_table(pos)? .visit_field::>>>("data", Self::VT_DATA, false)? .finish(); Ok(()) } } pub struct AvatarBaseTemplateTbArgs<'a> { pub data: Option>>>>, } impl<'a> Default for AvatarBaseTemplateTbArgs<'a> { #[inline] fn default() -> Self { AvatarBaseTemplateTbArgs { data: None, } } } pub struct AvatarBaseTemplateTbBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> { fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, start_: flatbuffers::WIPOffset, } impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> AvatarBaseTemplateTbBuilder<'a, 'b, A> { #[inline] pub fn add_data(&mut self, data: flatbuffers::WIPOffset>>>) { self.fbb_.push_slot_always::>(AvatarBaseTemplateTb::VT_DATA, data); } #[inline] pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> AvatarBaseTemplateTbBuilder<'a, 'b, A> { let start = _fbb.start_table(); AvatarBaseTemplateTbBuilder { fbb_: _fbb, start_: start, } } #[inline] pub fn finish(self) -> flatbuffers::WIPOffset> { let o = self.fbb_.end_table(self.start_); flatbuffers::WIPOffset::new(o.value()) } } impl core::fmt::Debug for AvatarBaseTemplateTb<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { let mut ds = f.debug_struct("AvatarBaseTemplateTb"); ds.field("data", &self.data()); ds.finish() } } #[inline] /// Verifies that a buffer of bytes contains a `AvatarBaseTemplateTb` /// and returns it. /// Note that verification is still experimental and may not /// catch every error, or be maximally performant. For the /// previous, unchecked, behavior use /// `root_as_avatar_base_template_tb_unchecked`. pub fn root_as_avatar_base_template_tb(buf: &[u8]) -> Result { flatbuffers::root::(buf) } #[inline] /// Verifies that a buffer of bytes contains a size prefixed /// `AvatarBaseTemplateTb` and returns it. /// Note that verification is still experimental and may not /// catch every error, or be maximally performant. For the /// previous, unchecked, behavior use /// `size_prefixed_root_as_avatar_base_template_tb_unchecked`. pub fn size_prefixed_root_as_avatar_base_template_tb(buf: &[u8]) -> Result { flatbuffers::size_prefixed_root::(buf) } #[inline] /// Verifies, with the given options, that a buffer of bytes /// contains a `AvatarBaseTemplateTb` and returns it. /// Note that verification is still experimental and may not /// catch every error, or be maximally performant. For the /// previous, unchecked, behavior use /// `root_as_avatar_base_template_tb_unchecked`. pub fn root_as_avatar_base_template_tb_with_opts<'b, 'o>( opts: &'o flatbuffers::VerifierOptions, buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { flatbuffers::root_with_opts::>(opts, buf) } #[inline] /// Verifies, with the given verifier options, that a buffer of /// bytes contains a size prefixed `AvatarBaseTemplateTb` and returns /// it. Note that verification is still experimental and may not /// catch every error, or be maximally performant. For the /// previous, unchecked, behavior use /// `root_as_avatar_base_template_tb_unchecked`. pub fn size_prefixed_root_as_avatar_base_template_tb_with_opts<'b, 'o>( opts: &'o flatbuffers::VerifierOptions, buf: &'b [u8], ) -> Result, flatbuffers::InvalidFlatbuffer> { flatbuffers::size_prefixed_root_with_opts::>(opts, buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a AvatarBaseTemplateTb and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid `AvatarBaseTemplateTb`. pub unsafe fn root_as_avatar_base_template_tb_unchecked(buf: &[u8]) -> AvatarBaseTemplateTb { flatbuffers::root_unchecked::(buf) } #[inline] /// Assumes, without verification, that a buffer of bytes contains a size prefixed AvatarBaseTemplateTb and returns it. /// # Safety /// Callers must trust the given bytes do indeed contain a valid size prefixed `AvatarBaseTemplateTb`. pub unsafe fn size_prefixed_root_as_avatar_base_template_tb_unchecked(buf: &[u8]) -> AvatarBaseTemplateTb { flatbuffers::size_prefixed_root_unchecked::(buf) } #[inline] pub fn finish_avatar_base_template_tb_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset>) { fbb.finish(root, None); } #[inline] pub fn finish_size_prefixed_avatar_base_template_tb_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset>) { fbb.finish_size_prefixed(root, None); }