pub enum StockWeapon {
Show 27 variants
Bat,
Bottle,
FireAxe,
Kukri,
Knife,
Fists,
Shovel,
Wrench,
Bonesaw,
Shotgun,
Scattergun,
SniperRifle,
Minigun,
SMG,
SyringeGun,
RocketLauncher,
GrenadeLauncher,
StickybombLauncher,
FlameThrower,
Pistol,
Revolver,
ConstructionPDA,
DestructionPDA,
DisguiseKit,
PDA,
MediGun,
InvisWatch,
}
Expand description
Stock weapons.
Variants§
Bat
Bottle
FireAxe
Kukri
Knife
Fists
Shovel
Wrench
Bonesaw
Shotgun
Scattergun
SniperRifle
Minigun
SMG
SyringeGun
RocketLauncher
GrenadeLauncher
StickybombLauncher
FlameThrower
Pistol
Revolver
ConstructionPDA
DestructionPDA
DisguiseKit
PDA
The PDA is defined in the schema but not used in-game, included here for thoroughness.
MediGun
InvisWatch
Implementations§
Source§impl StockWeapon
impl StockWeapon
Sourcepub fn defindex(&self) -> &'static [u32]
pub fn defindex(&self) -> &'static [u32]
Gets the set of related defindexes of the weapon. Excludes definitions for skinned items.
Sourcepub fn from_defindex(defindex: u32) -> Option<StockWeapon>
pub fn from_defindex(defindex: u32) -> Option<StockWeapon>
Attempts to create a StockWeapon
from a defindex. Excludes definitions for skinned
items.
Sourcepub fn defindex_is_stock_weapon(defindex: u32) -> bool
pub fn defindex_is_stock_weapon(defindex: u32) -> bool
Checks if the defindex
belongs to a stock weapon.
Sourcepub fn used_by_classes(&self) -> &'static [Class]
pub fn used_by_classes(&self) -> &'static [Class]
Gets the set of classes that can use this weapon.
Sourcepub fn used_by_class(&self, class: Class) -> bool
pub fn used_by_class(&self, class: Class) -> bool
Checks if the weapon is used by a specific class.
Sourcepub fn class_stock_weapons(class: Class) -> &'static [StockWeapon]
pub fn class_stock_weapons(class: Class) -> &'static [StockWeapon]
Gets the stock weapons available to a specific class.
Sourcepub fn item_slot(&self) -> ItemSlot
pub fn item_slot(&self) -> ItemSlot
Gets the item slot of the weapon for the class.
Note: StockWeapon::Shotgun
is a secondary weapon for the Soldier and Pyro classes
but a primary weapon for the Engineer class. It’s returned as ItemSlot::Secondary
here.
Trait Implementations§
Source§impl Clone for StockWeapon
impl Clone for StockWeapon
Source§fn clone(&self) -> StockWeapon
fn clone(&self) -> StockWeapon
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StockWeapon
impl Debug for StockWeapon
Source§impl<'de> Deserialize<'de> for StockWeapon
impl<'de> Deserialize<'de> for StockWeapon
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for StockWeapon
impl Display for StockWeapon
Source§impl FromStr for StockWeapon
impl FromStr for StockWeapon
Source§impl Hash for StockWeapon
impl Hash for StockWeapon
Source§impl IntoEnumIterator for StockWeapon
impl IntoEnumIterator for StockWeapon
Source§impl Ord for StockWeapon
impl Ord for StockWeapon
Source§fn cmp(&self, other: &StockWeapon) -> Ordering
fn cmp(&self, other: &StockWeapon) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for StockWeapon
impl PartialEq for StockWeapon
Source§impl PartialOrd for StockWeapon
impl PartialOrd for StockWeapon
Source§impl Serialize for StockWeapon
impl Serialize for StockWeapon
Source§impl TryFrom<&str> for StockWeapon
impl TryFrom<&str> for StockWeapon
Source§impl TryFrom<u32> for StockWeapon
impl TryFrom<u32> for StockWeapon
impl Copy for StockWeapon
impl Eq for StockWeapon
impl StructuralPartialEq for StockWeapon
Auto Trait Implementations§
impl Freeze for StockWeapon
impl RefUnwindSafe for StockWeapon
impl Send for StockWeapon
impl Sync for StockWeapon
impl Unpin for StockWeapon
impl UnwindSafe for StockWeapon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more