pub struct AreMiniGameBullet {
pub damage: u32,
pub lifespan: f32,
pub rate_of_fire: f32,
pub speed: f32,
pub target_type: u32,
pub bullet_model: ResRef,
pub collision_sound: ResRef,
}Expand description
The ballistics of one gun bank (Bullet).
The first five fields are a presence-gated chain: each read reports
whether the file supplied the field, and that gates whether the next one
is attempted at all. If any is genuinely absent the chain truncates and
the bank is never created, so there is no such thing as a partial bank
built from defaults. Bullet_Model and Collision_Sound are read
unconditionally once the chain completes.
The view models all seven as plain fields rather than making the chain
visible in the type. A file missing one of the five is malformed, and
saying so is a diagnostic’s job: the schema marks them required and lint
reports the dropped bank. Seven Options would push that judgement onto
every caller that only wanted to read a rate of fire.
Fields§
§damage: u32Damage per hit (Damage).
lifespan: f32Seconds before the bullet expires (Lifespan).
rate_of_fire: f32Seconds between shots (Rate_Of_Fire).
speed: f32Travel speed (Speed).
target_type: u32What the bank is allowed to shoot at (Target_Type).
bullet_model: ResRefBullet model resref (Bullet_Model).
collision_sound: ResRefSound played on impact (Collision_Sound).
Trait Implementations§
Source§impl Clone for AreMiniGameBullet
impl Clone for AreMiniGameBullet
Source§fn clone(&self) -> AreMiniGameBullet
fn clone(&self) -> AreMiniGameBullet
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 AreMiniGameBullet
impl Debug for AreMiniGameBullet
Source§impl Default for AreMiniGameBullet
impl Default for AreMiniGameBullet
Source§fn default() -> AreMiniGameBullet
fn default() -> AreMiniGameBullet
Source§impl PartialEq for AreMiniGameBullet
impl PartialEq for AreMiniGameBullet
Source§fn eq(&self, other: &AreMiniGameBullet) -> bool
fn eq(&self, other: &AreMiniGameBullet) -> bool
self and other values to be equal, and is used by ==.