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
MediGun
InvisWatch
Implementations§
Source§impl StockWeapon
impl StockWeapon
Sourcepub fn defindexes(&self) -> &'static [u32]
pub fn defindexes(&self) -> &'static [u32]
Gets the set of related defindexes of the weapon. Excludes definitions for skinned items.
Sourcepub fn econ_defindex(&self) -> Option<u32>
pub fn econ_defindex(&self) -> Option<u32>
Gets the economy defindex for this weapon (if available).
This is the defindex that can be mapped to inventory items. Not available for
StockWeapon::DestructionPDA
, StockWeapon::PDA
, and StockWeapon::DisguiseKit
.
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Source§impl Display for StockWeapon
impl Display for StockWeapon
Source§impl FromStr for StockWeapon
impl FromStr for StockWeapon
Source§impl HasItemDefindex for StockWeapon
impl HasItemDefindex for StockWeapon
Source§fn defindex(&self) -> u32
fn defindex(&self) -> u32
Gets the defindex for this item. If there are multiple, the first is returned.
If you want the defindex associated with inventory items, use
StockWeapon::econ_defindex
.
Source§fn from_defindex(defindex: u32) -> Option<Self>
fn from_defindex(defindex: u32) -> Option<Self>
Attempts to create a StockWeapon
from a defindex. Excludes definitions for skinned
items.