|
Player12
An open source football management simulator
|
#include <match_audio.h>
Public Member Functions | |
| void | collect (std::span< const MatchEvent > events, std::vector< const MatchEvent * > &fresh) |
| void | skipAll (std::span< const MatchEvent > events) |
Private Member Functions | |
| bool | isBefore (const MatchEvent &event) const |
| bool | isNew (const MatchEvent &event, std::uint64_t fingerprint) const |
| void | mark (const MatchEvent &event, std::uint64_t fingerprint) |
Private Attributes | |
| int | period = 0 |
| float | minute = -1.0f |
| std::array< std::uint64_t, SAME_TIME_CAPACITY > | sameTime {} |
| std::size_t | sameTimeCount = 0 |
Static Private Attributes | |
| static constexpr std::size_t | SAME_TIME_CAPACITY = 16 |
Remembers which match events were already heard. Events carry no id and the engine's log drops its oldest entries once full, so an event is known by its place in match time (period, clock) plus a fingerprint of its content. That identity survives log eviction, a replayed or re-created engine and seeking: an event is reported once, and never again.
| void MatchEventCursor::collect | ( | std::span< const MatchEvent > | events, |
| std::vector< const MatchEvent * > & | fresh | ||
| ) |
Appends events not heard yet (in log order) and marks them heard.
|
private |
Strictly earlier in match time than the last heard event.
|
private |
|
private |
| void MatchEventCursor::skipAll | ( | std::span< const MatchEvent > | events | ) |
Marks every event in events heard without reporting it.
|
private |
|
private |
|
staticconstexprprivate |
|
private |
Fingerprints of heard events at exactly (period, minute).
|
private |