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

Go to the source code of this file.

Classes

struct  NewsCompetition
 A competition a story belongs to (id 0: none). More...
 
struct  NewsItem
 One story of the world news feed. More...
 
struct  NewsSources
 The saved facts the feed is built from. More...
 
struct  NewsFilter
 What the news screen shows (unset fields: everything). More...
 

Namespaces

namespace  NewsFeed
 The world news feed: dated stories derived from saved data.
 

Enumerations

enum class  NewsKind : std::uint8_t {
  Transfer = 0 , Manager , Race , Upset ,
  Record , Award , COUNT
}
 What a news story is about (filter of the news screen). More...
 

Functions

const char * newsKindKey (NewsKind kind)
 
std::vector< NewsItem > NewsFeed::build (const NewsSources &sources, const GameDateValue &from, const GameDateValue &to)
 
std::vector< NewsItem > NewsFeed::forGame (const Game &game, const GameData &gamedata)
 
std::vector< std::size_t > NewsFeed::filter (std::span< const NewsItem > items, const NewsFilter &filter)
 
std::size_t NewsFeed::variant (NewsKind kind, std::uint32_t first, std::uint32_t second, const GameDateValue &date, std::size_t count)
 

Variables

constexpr std::uint32_t NewsFeed::MAJOR_FEE = 12'000'000
 
constexpr int NewsFeed::UPSET_REPUTATION_GAP = 18
 
constexpr std::uint16_t NewsFeed::LEADER_MIN_PLAYED = 6
 
constexpr int NewsFeed::RACE_GAMES_LEFT = 8
 
constexpr int NewsFeed::RACE_POINTS_GAP = 3
 

Enumeration Type Documentation

◆ NewsKind

enum class NewsKind : std::uint8_t
strong

What a news story is about (filter of the news screen).

Enumerator
Transfer 

Big-money moves and the managed club's deals.

Manager 

Appointments, sackings and departures.

Race 

Title races, new leaders, champions, promotions.

Upset 

Results against the odds.

Record 

Records set this season and later.

Award 

Monthly and season honours.

COUNT 

Function Documentation

◆ newsKindKey()

const char * newsKindKey ( NewsKind  kind)

Language key naming kind (e.g. "NEWS_KIND_TRANSFER").