|
Player12
An open source football management simulator
|
Chronological list of messages with read tracking. More...
#include <inbox.h>
Public Member Functions | |
| std::uint32_t | add (InboxMessage message) |
| const InboxView & | getView () const |
| void | setView (const InboxView &updated) |
| bool | markRead (std::uint32_t id) |
| void | markAllRead () |
| std::size_t | unreadCount () const |
| const std::vector< InboxMessage > & | getMessages () const |
| void | restore (std::vector< InboxMessage > messages) |
Static Public Member Functions | |
| static bool | isRoutine (const std::string &title_key) |
| static bool | isDigested (const std::string &title_key) |
| static InboxAction | actionFor (const std::string &title_key) |
| static bool | isDecision (InboxAction action) |
| static bool | isArchived (const InboxMessage &message, const GameDateValue &today) |
| static bool | matchesView (const InboxMessage &message, const InboxView &view, std::span< const PlayerID > followed) |
Static Public Attributes | |
| static constexpr std::size_t | MAX_MESSAGES = 400 |
| static constexpr std::int32_t | DIGEST_DAYS = 7 |
| static constexpr std::int32_t | ARCHIVE_DAYS = 14 |
Private Attributes | |
| std::vector< InboxMessage > | messages |
| std::uint32_t | next_id = 1 |
| InboxView | view |
Chronological list of messages with read tracking.
The inbox keeps the newest MAX_MESSAGES messages; older ones are dropped. Only news that needs the manager's attention arrives unread: routine round-ups (transfer news, instalments) are filed as read, and repeated offers of the same kind (bids and loan offers for the club's players) are grouped into a weekly digest with a single unread message.
|
static |
Action offered by messages with this title key.
| std::uint32_t Inbox::add | ( | InboxMessage | message | ) |
Appends a message, assigns its id and returns it.
| const std::vector< InboxMessage > & Inbox::getMessages | ( | ) | const |
Messages, oldest first.
|
inline |
Saved filters of the inbox screen.
|
static |
Read information older than ARCHIVE_DAYS on today.
|
static |
Actions that ask for a decision (pinned while pending).
|
static |
Messages grouped into a weekly digest (one unread per week).
|
static |
Routine news that is filed as read on arrival.
| void Inbox::markAllRead | ( | ) |
Marks every message as read.
| bool Inbox::markRead | ( | std::uint32_t | id | ) |
Marks a message as read; false if the id is unknown.
|
static |
True when message passes the information filters of view: category, unread, the chosen player or club, and the followed players (followed) when followed_only is set.
| void Inbox::restore | ( | std::vector< InboxMessage > | messages | ) |
Replaces the content with persisted messages.
|
inline |
| std::size_t Inbox::unreadCount | ( | ) | const |
Number of unread messages.
|
staticconstexpr |
Days after which read information leaves the main list.
|
staticconstexpr |
Window of the weekly digest of repeated offers and workload advice.
|
staticconstexpr |
|
private |
|
private |
|
private |