59 return w.
slots[
static_cast<std::size_t
>(s)];
63 return w.
slots[
static_cast<std::size_t
>(s)];
GunInstance & getSlot(WeaponState &w, WeaponSlot s)
Access a specific slot on a WeaponState by enum.
Definition WeaponState.hpp:57
GunInstance & getEquippedGun(WeaponState &w)
The slot the player is currently holding.
Definition WeaponState.hpp:67
WeaponSlot
Identifier for one of the player's weapon slots.
Definition WeaponState.hpp:28
@ SECONDARY
Definition WeaponState.hpp:30
@ PRIMARY
Definition WeaponState.hpp:29
@ Count
Sentinel — must be last. Equals the number of valid slots.
Definition WeaponState.hpp:31
WeaponType
Weapon type — determines tracer style, damage, sound, and impact effects.
Definition WeaponState.hpp:12
@ EnergyGun
Fast hitscan energy burst.
Definition WeaponState.hpp:16
@ Rocket
Slow arcing projectile (ribbon trail).
Definition WeaponState.hpp:14
@ RailGun
Hitscan energy weapon (beam + lightning arcs).
Definition WeaponState.hpp:15
@ Impulse
Sticky 1s fuse, big knockback, no damage (movement tool).
Definition WeaponState.hpp:19
@ Rifle
Fast hitscan/projectile (R301-style capsule tracer).
Definition WeaponState.hpp:13
@ HEGrenade
Bouncy grenade with 3s fuse, lethal explosion.
Definition WeaponState.hpp:17
@ Molotov
Impact-detonate, leaves a fire field (damage over time).
Definition WeaponState.hpp:18
Struct that defines this weapon's type, cooldown, and ammo.
Definition WeaponState.hpp:36
WeaponType type
Definition WeaponState.hpp:37
float fireCooldown
Definition WeaponState.hpp:40
float chargeTime
Accumulated charge time (charge weapons only).
Definition WeaponState.hpp:41
int currentMagAmmo
Definition WeaponState.hpp:39
int totalAmmo
Definition WeaponState.hpp:38
Component attached to armed entities (players).
Definition WeaponState.hpp:51
WeaponSlot current
Currently equipped slot.
Definition WeaponState.hpp:53
std::array< GunInstance, static_cast< std::size_t >(WeaponSlot::Count)> slots
Definition WeaponState.hpp:52