group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
WeaponState Struct Reference

Component attached to armed entities (players). More...

#include <WeaponState.hpp>

Public Attributes

std::array< GunInstance, static_cast< std::size_t >(WeaponSlot::Count)> slots {}
WeaponSlot current = WeaponSlot::PRIMARY
 Currently equipped slot.

Detailed Description

Component attached to armed entities (players).

Slots are stored in a fixed-size array indexed by WeaponSlot. Use the getSlot / getEquippedGun helpers below — do NOT index .slots directly from consumer code. This keeps the slot-ordering an implementation detail of WeaponState and lets us add slots without touching every consumer.

Member Data Documentation

◆ current

WeaponSlot WeaponState::current = WeaponSlot::PRIMARY

Currently equipped slot.

◆ slots

std::array<GunInstance, static_cast<std::size_t>(WeaponSlot::Count)> WeaponState::slots {}

The documentation for this struct was generated from the following file: