pub struct Weapon(/* private fields */);Expand description
A primary, secondary, or handgun weapon
Implementations§
Source§impl Weapon
impl Weapon
Sourcepub fn suppressor(&self) -> Option<&str>
pub fn suppressor(&self) -> Option<&str>
The class name of the attached suppressor
Sourcepub fn set_suppressor(&mut self, suppressor: String) -> bool
pub fn set_suppressor(&mut self, suppressor: String) -> bool
Set the class name of the attached suppressor Returns true if the suppressor was set, false if the weapon was not initialized
Sourcepub fn set_pointer(&mut self, pointer: String) -> bool
pub fn set_pointer(&mut self, pointer: String) -> bool
Set the class name of the attached pointer Returns true if the pointer was set, false if the weapon was not initialized
Sourcepub fn set_optic(&mut self, optic: String) -> bool
pub fn set_optic(&mut self, optic: String) -> bool
Set the class name of the attached optic Returns true if the optic was set, false if the weapon was not initialized
Sourcepub fn primary_magazine(&self) -> Option<&Magazine>
pub fn primary_magazine(&self) -> Option<&Magazine>
Get the inserted primary magazine
Sourcepub fn primary_magazine_mut(&mut self) -> Option<&mut Magazine>
pub fn primary_magazine_mut(&mut self) -> Option<&mut Magazine>
Get the inserted primary magazine mutably
Sourcepub fn set_primary_magazine(&mut self, primary: Magazine) -> bool
pub fn set_primary_magazine(&mut self, primary: Magazine) -> bool
Set the inserted primary magazine Returns true if the primary magazine was set, false if the weapon was not initialized
Sourcepub fn secondary_magazine(&self) -> Option<&Magazine>
pub fn secondary_magazine(&self) -> Option<&Magazine>
Get the inserted secondary magazine
Sourcepub fn secondary_magazine_mut(&mut self) -> Option<&mut Magazine>
pub fn secondary_magazine_mut(&mut self) -> Option<&mut Magazine>
Get the inserted secondary magazine mutably
Sourcepub fn set_secondary_magazine(&mut self, secondary: Magazine) -> bool
pub fn set_secondary_magazine(&mut self, secondary: Magazine) -> bool
Set the inserted secondary magazine Returns true if the secondary magazine was set, false if the weapon was not initialized