|
group2 0.1.0
CSE 125 Group 2
|
Weapon state component for armed entities. More...
#include <array>#include <cstddef>#include <cstdint>Go to the source code of this file.
Classes | |
| struct | GunInstance |
| Struct that defines this weapon's type, cooldown, and ammo. More... | |
| struct | WeaponState |
| Component attached to armed entities (players). More... | |
Enumerations | |
| enum class | WeaponType : uint8_t { Rifle , Rocket , RailGun , EnergyGun , HEGrenade , Molotov , Impulse } |
| Weapon type — determines tracer style, damage, sound, and impact effects. More... | |
| enum class | WeaponSlot : uint8_t { PRIMARY , SECONDARY , Count } |
| Identifier for one of the player's weapon slots. More... | |
Functions | |
| GunInstance & | getSlot (WeaponState &w, WeaponSlot s) |
| Access a specific slot on a WeaponState by enum. | |
| const GunInstance & | getSlot (const WeaponState &w, WeaponSlot s) |
| GunInstance & | getEquippedGun (WeaponState &w) |
| The slot the player is currently holding. | |
| const GunInstance & | getEquippedGun (const WeaponState &w) |
Weapon state component for armed entities.
|
strong |
Identifier for one of the player's weapon slots.
Count is a sentinel used to size the slots array; never use it as a real slot value. To add a new slot (e.g., melee), append before Count and update any per-slot policy helpers (see canAcceptType in a future commit). The slot array auto-resizes.
| Enumerator | |
|---|---|
| PRIMARY | |
| SECONDARY | |
| Count | Sentinel — must be last. Equals the number of valid slots. |
|
strong |
Weapon type — determines tracer style, damage, sound, and impact effects.
|
inline |
|
inline |
The slot the player is currently holding.
|
inline |
|
inline |