pub struct AreMiniGame {Show 15 fields
pub mini_game_type: u32,
pub movement_per_sec: f32,
pub lateral_accel: f32,
pub bump_plane: u32,
pub do_bumping: bool,
pub use_inertia: bool,
pub dof: u32,
pub music: ResRef,
pub far_clip: f32,
pub near_clip: f32,
pub camera_view_angle: f32,
pub player: Option<AreMiniGamePlayer>,
pub mouse: Option<AreMiniGameMouse>,
pub enemies: Vec<AreMiniGameEnemy>,
pub obstacles: Vec<AreMiniGameObstacle>,
}Expand description
Typed view over the ARE MiniGame nested struct.
Fields§
§mini_game_type: u32Mini-game type (Type): 1 = swoop, 2 = turret.
movement_per_sec: f32Movement speed (MovementPerSec).
lateral_accel: f32Lateral acceleration (LateralAccel).
bump_plane: u32Bump plane index (Bump_Plane).
do_bumping: boolBumping enabled (DoBumping).
use_inertia: boolInertia enabled (UseInertia).
dof: u32Degrees of freedom (DOF).
music: ResRefMusic resref (Music).
far_clip: f32Far clip distance (Far_Clip).
near_clip: f32Near clip distance (Near_Clip).
camera_view_angle: f32Camera view angle (CameraViewAngle).
player: Option<AreMiniGamePlayer>Player sub-struct (Player).
mouse: Option<AreMiniGameMouse>Mouse axis settings (Mouse), when the area carries the struct.
A sibling of Player, not a child of it. One vanilla minigame area of
four has it.
Option rather than a defaulted value, because presence and default
are different questions for a struct. A default answers what the
engine substitutes for an absent scalar; it says nothing about whether
a nested struct exists. Materializing an all-zero Mouse for the
three files without one and then writing it back would invent
structure those files never had. MiniGame itself is an Option on
Are for the same reason, so this matches the convention already in
place rather than adding a second one.
What the engine does with an absent Mouse is untraced, which is the
argument for Option rather than against it: preserving the file’s
actual state invents nothing under that ignorance.
enemies: Vec<AreMiniGameEnemy>Enemy list (Enemies), a sibling of Player.
obstacles: Vec<AreMiniGameObstacle>Obstacle list (Obstacles), a sibling of Player.
Implementations§
Source§impl AreMiniGame
impl AreMiniGame
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.
Sourcepub fn read_element(structure: &GffStruct) -> Self
pub fn read_element(structure: &GffStruct) -> Self
Reads one element of a list of this type.
Sourcepub fn write_element(&self, structure: &mut GffStruct)
pub fn write_element(&self, structure: &mut GffStruct)
Writes one element of a list of this type.
Trait Implementations§
Source§impl Clone for AreMiniGame
impl Clone for AreMiniGame
Source§fn clone(&self) -> AreMiniGame
fn clone(&self) -> AreMiniGame
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 AreMiniGame
impl Debug for AreMiniGame
Source§impl Default for AreMiniGame
impl Default for AreMiniGame
Source§impl HasSchema for AreMiniGame
impl HasSchema for AreMiniGame
Source§impl PartialEq for AreMiniGame
impl PartialEq for AreMiniGame
Source§fn eq(&self, other: &AreMiniGame) -> bool
fn eq(&self, other: &AreMiniGame) -> bool
self and other values to be equal, and is used by ==.