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

Snapshot of game state consumed by the HUD each frame. More...

#include <HudTypes.hpp>

Collaboration diagram for HudGameState:
[legend]

Public Attributes

const InputBindingsbindings = nullptr
 Live input bindings for HUD key prompts.
BindingDevice activeInputDevice {}
 Last-used input device; selects KBM vs controller glyphs (0 == KBM).
int health = 100
int maxHealth = 100
int armor = 0
int maxArmor = 100
int overShield = 0
int maxOverShield = 200
float abilityLevelProgress = 0.f
 accumDamage / systems::dmgThreshold, clamped 0..1.
int abilityLevel = 0
int ammoClip = 30
int ammoReserve = 90
int weaponId = 0
int primaryWeaponId = 0
 WeaponType ordinal in the primary slot.
int secondarySlotWeaponId = 2
 WeaponType ordinal in the secondary slot.
int activeWeaponSlot = 0
 0 = primary, 1 = secondary.
bool railgunScoped = false
 True while the local player holds right click with the railgun equipped.
float railgunChargeTime = 0.f
 Current GunInstance::chargeTime for the equipped railgun.
float roundTimeRemaining = 0.f
bool isAlive = true
MatchPhase currentPhase = MatchPhase::IN_PROGRESS
 Current server match phase.
bool matchWon = false
 True if the local player won the finished match.
bool forceScoreboardOpen = false
 True when match flow should show scoreboard automatically.
bool isReloading = false
float reloadProgress = 0.0f
 0-1
std::span< const HudKillFeedEntrykillFeedEvents
std::span< const HudDamageEventdamageEvents
std::span< const HudHitConfirmhitConfirms
std::span< const HudDamageNumberdamageNumbers
 Floating damage numbers to spawn this frame.
HudDamageAccum damageAccum
 Running damage total to current target.
HudShotgunBlast latestShotgunBlast
 Most recent shotgun blast; valid=false when none.
glm::mat4 viewProj {1.f}
std::span< const HudTeamMemberStatusallies
std::span< const HudTeamMemberStatusenemies
int allyScore = 0
int enemyScore = 0
float localPlayerX = 0.f
float localPlayerZ = 0.f
float localPlayerYaw = 0.f
 Player facing direction (radians, 0 = +Z, CW).
std::span< const HudMinimapDotenemyDots
float minimapWorldRange = 4000.f
 World units visible in each direction from center.
bool tookDamage = false
 True the frame health or armor decreased.
float damageIntensity = 0.f
 0..1 fraction of max-health lost this frame.
bool armorBroke = false
 True the frame armor dropped to zero.
bool pickupAvailable = false
 True when a pickup is currently actionable.
int pickupWeaponId = 0
 Mirrors WeaponType: 0=Rifle, 1=Rocket, 2=RailGun, 3=EnergyGun.
std::span< const HudWorldEnemyworldEnemies
 Enemies whose HP bars float above them in-world.
HudEquipmentState equipment
 Grapple / grenade / tactical state.
HudGrenadeRadialState grenadeRadial
 Held-G grenade selection radial.
HudEmoteWheelState emoteWheel
 Held-B emote selection wheel.
HudKillerBox killerBox
 Killcam: red box framing the killer while dead.
HudAbilitySelectionState abilitySelection
 Pending level-up ability choice.
std::span< const HudPickupNotificationpickupNotifications
 Slide-in pickup messages this frame.
std::span< const HudPopupMessagepopupMessages
 Generic popup messages this frame.
HudKdaCounter kda
 Local player kill/assist/death counter (top-right).
HudChatState chat
 Bottom-left all-chat log/input.
std::span< const HudVoiceSpeakervoiceSpeakers
 Currently audible proximity voice speakers.
HudMatchInfo matchInfo
 Match elapsed time + frag target (top-center header).
int gravityDirection = 0
 0=down, 1=left, 2=up, 3=right (HUD compass arrow).
int secondaryWeaponId = -1
 -1 = no inactive weapon loaded.
int secondaryClip = 0
 Mag count of the inactive weapon.
int secondaryReserve = 0
 Reserve count of the inactive weapon.
int secondaryKeybind = 2
 1 or 2 — the keybind that swaps to this slot.
int magCapacity = 0
 Max rounds per mag for the current weapon.
int secondaryMagCapacity = 0
 Max rounds per mag for the secondary weapon (when set).
float screenW = 1280.f
float screenH = 720.f

Detailed Description

Snapshot of game state consumed by the HUD each frame.

Filled by Game from ECS data. The HUD never imports ECS headers.

Member Data Documentation

◆ abilityLevel

int HudGameState::abilityLevel = 0

◆ abilityLevelProgress

float HudGameState::abilityLevelProgress = 0.f

accumDamage / systems::dmgThreshold, clamped 0..1.

◆ abilitySelection

HudAbilitySelectionState HudGameState::abilitySelection

Pending level-up ability choice.

◆ activeInputDevice

BindingDevice HudGameState::activeInputDevice {}

Last-used input device; selects KBM vs controller glyphs (0 == KBM).

◆ activeWeaponSlot

int HudGameState::activeWeaponSlot = 0

0 = primary, 1 = secondary.

◆ allies

std::span<const HudTeamMemberStatus> HudGameState::allies

◆ allyScore

int HudGameState::allyScore = 0

◆ ammoClip

int HudGameState::ammoClip = 30

◆ ammoReserve

int HudGameState::ammoReserve = 90

◆ armor

int HudGameState::armor = 0

◆ armorBroke

bool HudGameState::armorBroke = false

True the frame armor dropped to zero.

◆ bindings

const InputBindings* HudGameState::bindings = nullptr

Live input bindings for HUD key prompts.

◆ chat

HudChatState HudGameState::chat

Bottom-left all-chat log/input.

◆ currentPhase

MatchPhase HudGameState::currentPhase = MatchPhase::IN_PROGRESS

Current server match phase.

◆ damageAccum

HudDamageAccum HudGameState::damageAccum

Running damage total to current target.

◆ damageEvents

std::span<const HudDamageEvent> HudGameState::damageEvents

◆ damageIntensity

float HudGameState::damageIntensity = 0.f

0..1 fraction of max-health lost this frame.

◆ damageNumbers

std::span<const HudDamageNumber> HudGameState::damageNumbers

Floating damage numbers to spawn this frame.

◆ emoteWheel

HudEmoteWheelState HudGameState::emoteWheel

Held-B emote selection wheel.

◆ enemies

std::span<const HudTeamMemberStatus> HudGameState::enemies

◆ enemyDots

std::span<const HudMinimapDot> HudGameState::enemyDots

◆ enemyScore

int HudGameState::enemyScore = 0

◆ equipment

HudEquipmentState HudGameState::equipment

Grapple / grenade / tactical state.

◆ forceScoreboardOpen

bool HudGameState::forceScoreboardOpen = false

True when match flow should show scoreboard automatically.

◆ gravityDirection

int HudGameState::gravityDirection = 0

0=down, 1=left, 2=up, 3=right (HUD compass arrow).

◆ grenadeRadial

HudGrenadeRadialState HudGameState::grenadeRadial

Held-G grenade selection radial.

◆ health

int HudGameState::health = 100

◆ hitConfirms

std::span<const HudHitConfirm> HudGameState::hitConfirms

◆ isAlive

bool HudGameState::isAlive = true

◆ isReloading

bool HudGameState::isReloading = false

◆ kda

HudKdaCounter HudGameState::kda

Local player kill/assist/death counter (top-right).

◆ killerBox

HudKillerBox HudGameState::killerBox

Killcam: red box framing the killer while dead.

◆ killFeedEvents

std::span<const HudKillFeedEntry> HudGameState::killFeedEvents

◆ latestShotgunBlast

HudShotgunBlast HudGameState::latestShotgunBlast

Most recent shotgun blast; valid=false when none.

◆ localPlayerX

float HudGameState::localPlayerX = 0.f

◆ localPlayerYaw

float HudGameState::localPlayerYaw = 0.f

Player facing direction (radians, 0 = +Z, CW).

◆ localPlayerZ

float HudGameState::localPlayerZ = 0.f

◆ magCapacity

int HudGameState::magCapacity = 0

Max rounds per mag for the current weapon.

◆ matchInfo

HudMatchInfo HudGameState::matchInfo

Match elapsed time + frag target (top-center header).

◆ matchWon

bool HudGameState::matchWon = false

True if the local player won the finished match.

◆ maxArmor

int HudGameState::maxArmor = 100

◆ maxHealth

int HudGameState::maxHealth = 100

◆ maxOverShield

int HudGameState::maxOverShield = 200

◆ minimapWorldRange

float HudGameState::minimapWorldRange = 4000.f

World units visible in each direction from center.

◆ overShield

int HudGameState::overShield = 0

◆ pickupAvailable

bool HudGameState::pickupAvailable = false

True when a pickup is currently actionable.

◆ pickupNotifications

std::span<const HudPickupNotification> HudGameState::pickupNotifications

Slide-in pickup messages this frame.

◆ pickupWeaponId

int HudGameState::pickupWeaponId = 0

Mirrors WeaponType: 0=Rifle, 1=Rocket, 2=RailGun, 3=EnergyGun.

◆ popupMessages

std::span<const HudPopupMessage> HudGameState::popupMessages

Generic popup messages this frame.

◆ primaryWeaponId

int HudGameState::primaryWeaponId = 0

WeaponType ordinal in the primary slot.

◆ railgunChargeTime

float HudGameState::railgunChargeTime = 0.f

Current GunInstance::chargeTime for the equipped railgun.

◆ railgunScoped

bool HudGameState::railgunScoped = false

True while the local player holds right click with the railgun equipped.

◆ reloadProgress

float HudGameState::reloadProgress = 0.0f

0-1

◆ roundTimeRemaining

float HudGameState::roundTimeRemaining = 0.f

◆ screenH

float HudGameState::screenH = 720.f

◆ screenW

float HudGameState::screenW = 1280.f

◆ secondaryClip

int HudGameState::secondaryClip = 0

Mag count of the inactive weapon.

◆ secondaryKeybind

int HudGameState::secondaryKeybind = 2

1 or 2 — the keybind that swaps to this slot.

◆ secondaryMagCapacity

int HudGameState::secondaryMagCapacity = 0

Max rounds per mag for the secondary weapon (when set).

◆ secondaryReserve

int HudGameState::secondaryReserve = 0

Reserve count of the inactive weapon.

◆ secondarySlotWeaponId

int HudGameState::secondarySlotWeaponId = 2

WeaponType ordinal in the secondary slot.

◆ secondaryWeaponId

int HudGameState::secondaryWeaponId = -1

-1 = no inactive weapon loaded.

◆ tookDamage

bool HudGameState::tookDamage = false

True the frame health or armor decreased.

◆ viewProj

glm::mat4 HudGameState::viewProj {1.f}

◆ voiceSpeakers

std::span<const HudVoiceSpeaker> HudGameState::voiceSpeakers

Currently audible proximity voice speakers.

◆ weaponId

int HudGameState::weaponId = 0

◆ worldEnemies

std::span<const HudWorldEnemy> HudGameState::worldEnemies

Enemies whose HP bars float above them in-world.


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