Player12
An open source football management simulator
Loading...
Searching...
No Matches
inbox.h File Reference
#include <cstddef>
#include <cstdint>
#include <optional>
#include <span>
#include <string>
#include <vector>
#include "global/types.h"
#include "model/gamedate.h"

Go to the source code of this file.

Classes

struct  InboxView
 Filters of the inbox screen, kept with the career (table InboxView) so they survive a scene change and a reload. More...
 
struct  InboxMessage
 A news item for the managed club. More...
 
class  Inbox
 Chronological list of messages with read tracking. More...
 

Enumerations

enum class  InboxCategory : std::uint8_t {
  General = 0 , Match , Injury , Transfer ,
  Contract , Youth , Board , Finance ,
  COUNT
}
 Message categories (values are persisted). More...
 
enum class  InboxAction : std::uint8_t {
  None = 0 , RespondOffer , ReplyToPlayer , YouthTrialists ,
  Shortlist , Dilemma
}
 What the manager can do straight from a message. Derived from the title key (see Inbox::actionFor()), so producers only need to add their key to the table in inbox.cpp; the linked player identifies the entity. More...
 

Functions

const char * inboxCategoryKey (InboxCategory category)
 
std::string formatLocalized (const std::string &key, const std::vector< std::string > &args)
 
std::string localizedDate (const std::string &text)
 
std::string formatMoney (std::int64_t amount)
 

Enumeration Type Documentation

◆ InboxAction

enum class InboxAction : std::uint8_t
strong

What the manager can do straight from a message. Derived from the title key (see Inbox::actionFor()), so producers only need to add their key to the table in inbox.cpp; the linked player identifies the entity.

Enumerator
None 
RespondOffer 

Accept / reject / counter a bid for player_id.

ReplyToPlayer 

Answer player_id's request or story.

YouthTrialists 

Sign or release the intake trialists.

Shortlist 

Add the recommended player_id to the shortlist.

Dilemma 

Pick one of the two answers of a decision moment.

◆ InboxCategory

enum class InboxCategory : std::uint8_t
strong

Message categories (values are persisted).

Enumerator
General 
Match 
Injury 
Transfer 
Contract 
Youth 
Board 
Finance 
COUNT 

Function Documentation

◆ formatLocalized()

std::string formatLocalized ( const std::string &  key,
const std::vector< std::string > &  args 
)

Formats a localised template, substituting {n} with args.

Arguments starting with '@' are language keys; ISO dates ("2027-06-30") are shown with the localised month. Two placeholder forms serve grammar: "{n:di}" puts the Italian preposition and article before club name n ("della Roma", see ClubArticle), and "{n|one|other}" picks a word by whether argument n is 1 ("{0} {0|giorno|giorni}").

◆ formatMoney()

std::string formatMoney ( std::int64_t  amount)

Money for a message argument: "€" and the plain amount ("€1250000"), shown by formatLocalized() in the reader's language ("€1.25M", "€ 1,25 mln"), so saved messages follow a later change of language.

◆ inboxCategoryKey()

const char * inboxCategoryKey ( InboxCategory  category)

Language key naming category (e.g. "INBOX_CAT_MATCH").

◆ localizedDate()

std::string localizedDate ( const std::string &  text)

An ISO date ("2027-06-30", GameDateValue::toString()) in the current language, e.g. "30 giu 2027"; any other text is returned unchanged.