pub struct AreMiniGameGunBank {
pub bank_id: u32,
pub gun_model: ResRef,
pub bullet: Option<AreMiniGameBullet>,
pub fire_sound: ResRef,
pub targeting: Option<AreMiniGameTargeting>,
}Expand description
One entry in a vehicle’s Gun_Banks list.
Fields§
§bank_id: u32Which hardpoint this bank occupies (BankID).
BANK_ID_NONE means the engine skips the bank entirely.
gun_model: ResRefGun model resref (Gun_Model).
An invalid or absent resref aborts the bank, so an empty value here describes a bank that will not be created.
bullet: Option<AreMiniGameBullet>Ballistics (Bullet), absent when the bank carries no such struct.
Option because absence is not the same as a zeroed struct. The
engine skips a bank with no Bullet; a view that materialised an
all-zero one and wrote it back would turn a bank the engine drops into
one it creates and fires at zero speed. That is a silent change of
meaning on write, which is the failure this type exists to avoid.
fire_sound: ResRefSound played when the bank fires (Fire_Sound).
A sibling of Bullet, not a field inside it, despite reading like one.
targeting: Option<AreMiniGameTargeting>AI aiming parameters, absent on a player’s own banks.
Flat on the bank entry rather than under a label of its own, so the
four sit beside Bullet in the file. Whether the bank carries them at
all is a rule no attribute states, which is why both codec halves are
this type’s: the engine reads the four as a presence-gated chain and
drops the whole bank if one is missing, so a partial set is not a
group to fill in with defaults.
Implementations§
Source§impl AreMiniGameGunBank
impl AreMiniGameGunBank
Sourcepub const PARTS: &'static [&'static [Field]]
pub const PARTS: &'static [&'static [Field]]
This type’s schema in parts, which is what a container holding it references.
Own fields first, then one part per flattened child in the order they are declared.
Sourcepub fn read_declared(root: &GffStruct) -> Self
pub fn read_declared(root: &GffStruct) -> Self
Reads every declared field off root.
Absent fields take the entry’s own answer, so a fallback is derived from the declaration rather than restated beside it.
A field declaring a hand-written read is left at that answer for the view to overwrite.
Sourcepub fn write_declared(&self, root: &mut GffStruct)
pub fn write_declared(&self, root: &mut GffStruct)
Writes every declared field onto root, leaving out the ones
their entry says the engine’s own writer leaves out.
A field declaring a hand-written write is not touched here.
Trait Implementations§
Source§impl Clone for AreMiniGameGunBank
impl Clone for AreMiniGameGunBank
Source§fn clone(&self) -> AreMiniGameGunBank
fn clone(&self) -> AreMiniGameGunBank
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AreMiniGameGunBank
impl Debug for AreMiniGameGunBank
Source§impl Default for AreMiniGameGunBank
impl Default for AreMiniGameGunBank
Source§impl HasSchema for AreMiniGameGunBank
impl HasSchema for AreMiniGameGunBank
Source§impl PartialEq for AreMiniGameGunBank
impl PartialEq for AreMiniGameGunBank
Source§fn eq(&self, other: &AreMiniGameGunBank) -> bool
fn eq(&self, other: &AreMiniGameGunBank) -> bool
self and other values to be equal, and is used by ==.