Player12
An open source football management simulator
Loading...
Searching...
No Matches
SupporterModel Namespace Reference

Pure supporter rules (no game state), unit tested in isolation. More...

Functions

SupporterMood evaluate (const SupporterFacts &facts)
 
float settle (float previous, float target)
 
float boardNudge (float index)
 
const char * moodKey (float index)
 
const char * reasonKey (const SupporterReason &reason)
 

Variables

constexpr float NEUTRAL = 55.0f
 
constexpr float MAX_BOARD_NUDGE = 0.25f
 
constexpr float BOARD_DEAD_ZONE = 15.0f
 
constexpr int STAR_WINDOW_DAYS = 120
 
constexpr int STAR_RANK = 3
 

Detailed Description

Pure supporter rules (no game state), unit tested in isolation.

Function Documentation

◆ boardNudge()

float SupporterModel::boardNudge ( float  index)

Weekly nudge to the board's confidence: nothing within BOARD_DEAD_ZONE of 50, then linear up to +-MAX_BOARD_NUDGE at 0 and 100.

◆ evaluate()

SupporterMood SupporterModel::evaluate ( const SupporterFacts &  facts)

The mood the facts point to: results against expectation weigh most (up to +-30), then derbies (+-12), ticket prices (-12 ... +6), star sales (-9 each, at most -18) and star signings (+5 each, at most +10).

◆ moodKey()

const char * SupporterModel::moodKey ( float  index)

Language key describing the index ("SUPPORTERS_MOOD_CONTENT", ...).

◆ reasonKey()

const char * SupporterModel::reasonKey ( const SupporterReason &  reason)

Language key explaining reason ("SUPPORTERS_REASON_DERBY_WON", ...).

◆ settle()

float SupporterModel::settle ( float  previous,
float  target 
)

Weekly step of the index towards target (moods change slowly).

Variable Documentation

◆ BOARD_DEAD_ZONE

constexpr float SupporterModel::BOARD_DEAD_ZONE = 15.0f
inlineconstexpr

Distance from 50 within which the board does not listen to the fans.

◆ MAX_BOARD_NUDGE

constexpr float SupporterModel::MAX_BOARD_NUDGE = 0.25f
inlineconstexpr

Largest weekly move of the board's confidence from the supporters.

◆ NEUTRAL

constexpr float SupporterModel::NEUTRAL = 55.0f
inlineconstexpr

Index of supporters with nothing to cheer or complain about.

◆ STAR_RANK

constexpr int SupporterModel::STAR_RANK = 3
inlineconstexpr

Best players of the squad who count as stars.

◆ STAR_WINDOW_DAYS

constexpr int SupporterModel::STAR_WINDOW_DAYS = 120
inlineconstexpr

How long a star sale or signing stays on the supporters' minds.