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 diamondSize = 10.f;
29 float fadeOutDuration = 0.6f;
30 int maxEntries = 4;
31
32 KillFeed();
33 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
34 void draw(HudContext& ctx, float drawX, float drawY) override;
35
36private:
37 struct Entry
38 {
39 std::string killerName;
40 std::string victimName;
41 bool isHeadshot = false;
42 bool youAreKiller = false;
43 bool youAreVictim = false;
44 bool permanent = false;
45 float timer = 0.f;
46 float slideIn = 1.f;
47 };
48 std::vector<Entry> entries_;
49};
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:38
bool youAreVictim
Definition KillFeed.hpp:43
std::string killerName
Definition KillFeed.hpp:39
bool youAreKiller
Definition KillFeed.hpp:42
float timer
Definition KillFeed.hpp:45
float slideIn
1 = settled, 0 = just-spawned (animates in).
Definition KillFeed.hpp:46
bool permanent
Definition KillFeed.hpp:44
bool isHeadshot
Definition KillFeed.hpp:41
std::string victimName
Definition KillFeed.hpp:40
float diamondSize
Definition KillFeed.hpp:28
KillFeed()
Definition KillFeed.cpp:21
float fontSize
Definition KillFeed.hpp:27
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition KillFeed.cpp:61
float fadeOutDuration
Definition KillFeed.hpp:29
float entryPadding
Definition KillFeed.hpp:25
std::vector< Entry > entries_
Definition KillFeed.hpp:48
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:28
float entryLifetime
Definition KillFeed.hpp:26
int maxEntries
Definition KillFeed.hpp:30