group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
KillFeed.hpp
Go to the documentation of this file.
1
14
15#pragma once
16
17#include "hud/HudWidget.hpp"
18
19#include <string>
20#include <vector>
21
23{
24 float entryHeight = 40.f;
25 float entryPadding = 30.f;
26 float entryLifetime = 5.f;
27 float fontSize = 20.f;
28 float fadeOutDuration = 0.6f;
29 int maxEntries = 4;
30
31 KillFeed();
32 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
33 void draw(HudContext& ctx, float drawX, float drawY) override;
34
35private:
36 struct Entry
37 {
38 std::string killerName;
39 std::string victimName;
40 bool isHeadshot = false;
41 bool youAreKiller = false;
42 bool youAreVictim = false;
43 bool permanent = false;
44 float timer = 0.f;
45 float slideIn = 1.f;
46 };
47 std::vector<Entry> entries_;
48};
Base struct for all HUD widgets.
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:19
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:367
Base class for a retained HUD element.
Definition HudWidget.hpp:16
Definition KillFeed.hpp:37
bool youAreVictim
Definition KillFeed.hpp:42
std::string killerName
Definition KillFeed.hpp:38
bool youAreKiller
Definition KillFeed.hpp:41
float timer
Definition KillFeed.hpp:44
float slideIn
1 = settled, 0 = just-spawned (animates in).
Definition KillFeed.hpp:45
bool permanent
Definition KillFeed.hpp:43
bool isHeadshot
Definition KillFeed.hpp:40
std::string victimName
Definition KillFeed.hpp:39
KillFeed()
Definition KillFeed.cpp:31
float fontSize
Definition KillFeed.hpp:27
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition KillFeed.cpp:71
float fadeOutDuration
Definition KillFeed.hpp:28
float entryPadding
Definition KillFeed.hpp:25
std::vector< Entry > entries_
Definition KillFeed.hpp:47
float entryHeight
Definition KillFeed.hpp:24
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition KillFeed.cpp:38
float entryLifetime
Definition KillFeed.hpp:26
int maxEntries
Definition KillFeed.hpp:29