group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
TeamStatusBar.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "hud/HudWidget.hpp"
5
7{
8 float indicatorSize = 14.f;
9 float indicatorSpacing = 5.f;
10 float scoreFontSize = 24.f;
11
13 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
14 void draw(HudContext& ctx, float drawX, float drawY) override;
15
16private:
17 int allyAlive_ = 0, allyTotal_ = 0;
19 int allyScore_ = 0, enemyScore_ = 0;
20};
Base struct for all HUD widgets.
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:18
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:148
Base class for a retained HUD element.
Definition HudWidget.hpp:16
int enemyAlive_
Definition TeamStatusBar.hpp:18
int allyTotal_
Definition TeamStatusBar.hpp:17
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition TeamStatusBar.cpp:13
float scoreFontSize
Definition TeamStatusBar.hpp:10
int enemyScore_
Definition TeamStatusBar.hpp:19
float indicatorSpacing
Definition TeamStatusBar.hpp:9
int allyScore_
Definition TeamStatusBar.hpp:19
TeamStatusBar()
Definition TeamStatusBar.cpp:6
float indicatorSize
Definition TeamStatusBar.hpp:8
int allyAlive_
Definition TeamStatusBar.hpp:17
int enemyTotal_
Definition TeamStatusBar.hpp:18
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition TeamStatusBar.cpp:31