Player12
An open source football management simulator
Loading...
Searching...
No Matches
scout_expertise.h File Reference
#include <cstdint>
#include <map>
#include <span>
#include <utility>
#include <vector>
#include "global/languages.h"
#include "global/types.h"

Go to the source code of this file.

Classes

struct  ScoutExpertise
 Where a scout comes from and what he knows. More...
 
struct  EffectFactor
 One line of the breakdown, e.g. "Speaks Portuguese +10%". More...
 
struct  ScoutEffectiveness
 How well a scout will do on an assignment. More...
 
struct  TargetCountry
 A country covered by an assignment and the scout's history there. More...
 

Namespaces

namespace  ScoutExpertiseModel
 Generation of scout backgrounds and the effectiveness model. [P].
 

Typedefs

using LanguageSet = std::uint32_t
 

Enumerations

enum class  SpokenLanguage : std::uint8_t {
  English = 0 , Italian , Spanish , French ,
  German , Portuguese , Dutch , Russian ,
  Swedish , Polish , Greek , Turkish ,
  Arabic , Japanese , Chinese , Korean ,
  Romanian , Croatian , Danish , Finnish ,
  Norwegian , Slovak , Czech , Hungarian ,
  Ukrainian , COUNT
}
 Languages a scout can speak (bit positions are persisted). More...
 
enum class  Continent : std::uint8_t {
  Europe = 0 , NorthAmerica , SouthAmerica , Asia ,
  COUNT
}
 Continents (values are shown, not persisted). More...
 
enum class  EffectFactorKind : std::uint8_t {
  Judging , HomeCountry , KnowsLeague , KnowsCountry ,
  SpeaksLanguage , LanguageBarrier , FarFromHome
}
 Kind of a line of the effectiveness breakdown. More...
 

Functions

constexpr LanguageSet languageBit (SpokenLanguage language)
 
constexpr bool speaks (LanguageSet languages, SpokenLanguage language)
 
const char * spokenLanguageKey (SpokenLanguage language)
 
const char * continentKey (Continent continent)
 
SpokenLanguage nativeLanguage (Language nationality)
 
Continent homeContinent (Language nationality)
 
Language countryNationality (LeagueID country)
 
SpokenLanguage countryLanguage (LeagueID country)
 
Continent countryContinent (LeagueID country)
 
ScoutExpertise ScoutExpertiseModel::generate (Language nationality, std::uint64_t world_seed, std::uint32_t scout_id, std::span< const LeagueID > countries)
 
ScoutEffectiveness ScoutExpertiseModel::compute (const ScoutExpertise &expertise, std::uint8_t judging_ability, std::span< const TargetCountry > countries, LeagueID league, std::uint32_t league_days)
 

Variables

constexpr float ScoutExpertiseModel::MIN_MULTIPLIER = 0.6f
 
constexpr float ScoutExpertiseModel::MAX_MULTIPLIER = 1.5f
 
constexpr float ScoutExpertiseModel::JUDGING_PER_POINT = 0.004f
 
constexpr float ScoutExpertiseModel::HOME_COUNTRY = 0.20f
 
constexpr float ScoutExpertiseModel::KNOWS_LEAGUE = 0.20f
 
constexpr float ScoutExpertiseModel::KNOWS_COUNTRY = 0.10f
 
constexpr float ScoutExpertiseModel::SPEAKS_LANGUAGE = 0.10f
 
constexpr float ScoutExpertiseModel::LANGUAGE_BARRIER = -0.15f
 
constexpr float ScoutExpertiseModel::FAR_FROM_HOME = -0.10f
 
constexpr float ScoutExpertiseModel::FULL_EXPERIENCE_DAYS = 365.0f
 
constexpr std::uint16_t ScoutExpertiseModel::LANGUAGE_LEARNED_DAYS = 540
 
constexpr std::uint16_t ScoutExpertiseModel::MAX_LEAGUE_DAYS = 9'999
 

Typedef Documentation

◆ LanguageSet

using LanguageSet = std::uint32_t

Bit set of SpokenLanguage values.

Enumeration Type Documentation

◆ Continent

enum class Continent : std::uint8_t
strong

Continents (values are shown, not persisted).

Enumerator
Europe 
NorthAmerica 
SouthAmerica 
Asia 
COUNT 

◆ EffectFactorKind

enum class EffectFactorKind : std::uint8_t
strong

Kind of a line of the effectiveness breakdown.

Enumerator
Judging 

subject: judging ability (1-100).

HomeCountry 

subject: country (top league id).

KnowsLeague 

subject: league id.

KnowsCountry 

subject: country (top league id).

SpeaksLanguage 

subject: SpokenLanguage.

LanguageBarrier 

subject: SpokenLanguage.

FarFromHome 

subject: Continent of the target.

◆ SpokenLanguage

enum class SpokenLanguage : std::uint8_t
strong

Languages a scout can speak (bit positions are persisted).

Enumerator
English 
Italian 
Spanish 
French 
German 
Portuguese 
Dutch 
Russian 
Swedish 
Polish 
Greek 
Turkish 
Arabic 
Japanese 
Chinese 
Korean 
Romanian 
Croatian 
Danish 
Finnish 
Norwegian 
Slovak 
Czech 
Hungarian 
Ukrainian 
COUNT 

Function Documentation

◆ continentKey()

const char * continentKey ( Continent  continent)

Language key of a continent ("SCOUT_CONTINENT_EUROPE"...).

◆ countryContinent()

Continent countryContinent ( LeagueID  country)

◆ countryLanguage()

SpokenLanguage countryLanguage ( LeagueID  country)

◆ countryNationality()

Language countryNationality ( LeagueID  country)

Country data of a league country, identified by its top league id (the root of the league tree, like ScoutTargetKind::Country).

◆ homeContinent()

Continent homeContinent ( Language  nationality)

Continent a nationality comes from.

◆ languageBit()

constexpr LanguageSet languageBit ( SpokenLanguage  language)
constexpr

◆ nativeLanguage()

SpokenLanguage nativeLanguage ( Language  nationality)

First language of a nationality.

◆ speaks()

constexpr bool speaks ( LanguageSet  languages,
SpokenLanguage  language 
)
constexpr

◆ spokenLanguageKey()

const char * spokenLanguageKey ( SpokenLanguage  language)

Language key of a spoken language ("SCOUT_LANG_ENGLISH"...).