Player12
An open source football management simulator
Loading...
Searching...
No Matches
ScoutingScene Class Reference

Scouting and recruitment: scouts, assignments, reports, player search on estimated values, shortlist and recruitment focus. More...

#include <scouting_scene.h>

Inheritance diagram for ScoutingScene:
ManagementScene GUIScene

Classes

struct  AssignmentLine
 
struct  ComparisonLine
 
struct  ContinentNode
 
struct  CountryNode
 
struct  EffectLine
 
struct  PlayerLine
 Display-ready estimated player row. More...
 
struct  ReportLine
 
struct  ScoutLine
 One row of the scouts list. More...
 

Public Types

enum class  Tab : uint8_t {
  OVERVIEW , REPORTS , SEARCH , SHORTLIST ,
  FOCUS
}
 Tabs of the screen. More...
 

Public Member Functions

 ScoutingScene (GUIView *parent, Tab initialTab=Tab::OVERVIEW)
 
void update (float deltaTime) override
 Updates scene logic.
 
SceneID getID () const override
 Gets the ID of the scene.
 
- Public Member Functions inherited from ManagementScene
 ManagementScene (GUIView *guiViewPtr)
 
void render () final
 Renders the scene.
 
void onEnter () override
 Called when the scene is entered/becomes active.
 
void onResume () override
 Called when an overlay above this scene closes and it becomes the active scene again. Screens use it to refresh cached view models after a match, a transfer or any other state change made elsewhere.
 
void handleEvent (const SDL_Event &event) override
 
std::optional< NavEntry > historyEntry () const override
 
- Public Member Functions inherited from GUIScene
 GUIScene (GUIView *guiView_ptr)
 Constructs a new GUIScene.
 
virtual ~GUIScene ()=default
 Destroys the GUIScene.
 
virtual void onExit ()
 Called when the scene is exited/becomes inactive.
 
virtual void onResize (int width, int height)
 Called when the window is resized.
 

Protected Member Functions

void renderContent () override
 Draws the page body inside the content region.
 
NavSection navSection () const override
 Sidebar entry highlighted for this screen.
 
void refresh () override
 Rebuilds cached view models from the game state.
 
- Protected Member Functions inherited from ManagementScene
virtual std::optional< EditorContext > editorContext () const
 
void showToast (std::string message, bool isError=false)
 Shows a short confirmation message in the top bar.
 
HolidayDialog & holidayDialog ()
 Holiday planner and return report of this screen.
 
- Protected Member Functions inherited from GUIScene
SDL_Renderer * getRenderer () const
 Gets the SDL renderer.
 
SDL_Window * getWindow () const
 Gets the SDL window.
 
GUIView * getGuiView () const
 Gets the associated GUIView.
 
void changeScene (std::unique_ptr< GUIScene > newScene)
 Requests a scene change.
 
void quit ()
 Requests the application to quit.
 

Private Types

enum class  ReportColumn : uint8_t {
  PLAYER , GRADE , ABILITY , POTENTIAL ,
  FEE , DATE
}
 
enum class  SearchColumn : uint8_t {
  NAME , CLUB , ROLE , AGE ,
  ABILITY , POTENTIAL , KNOWLEDGE , VALUE
}
 

Private Member Functions

void rebuildReports ()
 
void rebuildSearch ()
 
void rebuildShortlist ()
 
void rebuildScouts ()
 
void rebuildWorld ()
 
void rebuildScoutDetail ()
 
void rebuildScoutReportList ()
 
void rebuildSendPreview ()
 
void rebuildPlayerMatches ()
 
void sortScoutReports ()
 
void selectScout (uint32_t scoutId)
 
ReportLine makeReportLine (const ScoutReport &report) const
 
std::string targetLabel (ScoutTargetKind kind, uint32_t targetId) const
 
std::string effectText (const EffectFactor &factor) const
 
const ScoutLine * selectedScoutLine () const
 
PlayerLine makeLine (const ScoutedPlayerRow &row) const
 
void sortSearch ()
 
void renderOverview ()
 
void renderScoutList (float width, float height)
 
void renderScoutDetail (float height)
 
void renderScoutHeader (const ScoutLine &line) const
 
void renderActiveAssignment (const ScoutLine &line)
 
void renderScoutHistory ()
 
void renderScoutReports (const char *id, float height)
 
void renderSendFlow (const ScoutLine &line)
 
void renderWorldPicker (float width, float height)
 
void renderSendSummary (const ScoutLine &line)
 
void renderReports ()
 
void renderSearch ()
 
void renderSearchFilters ()
 
void renderPlayerTable (const char *id, std::vector< PlayerLine > &lines, float height, bool sortable)
 
void renderShortlist ()
 
void renderComparison ()
 
void renderFocus ()
 
void renderFocusEditor ()
 
void renderPlayerActions ()
 
void selectPlayer (PlayerID playerId, std::string_view name)
 
void sendScout (ScoutTargetKind kind, uint32_t targetId)
 
bool playerCell (PlayerID playerId, const std::string &name, bool selected)
 

Private Attributes

std::vector< ScoutProfile > scouts
 
std::vector< ReportLine > reports
 
std::vector< PlayerLine > search_rows
 
std::vector< PlayerLine > shortlist_rows
 
std::vector< ComparisonLine > comparison
 
std::vector< std::pair< LeagueID, std::string > > leagues
 
std::vector< ScoutLine > scout_lines
 
std::vector< ContinentNode > world
 
uint32_t selected_scout = 0
 
ScoutExpertise selected_expertise
 
std::string languages_full
 
std::vector< std::string > expertise_lines
 
std::vector< ReportLine > scout_reports
 
std::vector< AssignmentLine > scout_history
 
uint32_t history_assignment = 0
 
std::vector< uint32_t > fresh_reports
 
ReportColumn report_sort = ReportColumn::DATE
 
bool report_sort_ascending = false
 
bool send_open = false
 
ScoutTargetKind send_kind = ScoutTargetKind::League
 
uint32_t send_target = 0
 
int send_days = 30
 
bool send_dirty = true
 
int64_t send_cost = 0
 
ScoutEffectiveness send_effect
 
std::vector< EffectLine > effect_lines
 
std::string send_target_text
 
std::array< char, 48 > player_query {}
 
std::vector< std::pair< PlayerID, std::string > > player_matches
 
std::unordered_map< uint64_t, float > picker_multipliers
 
ScoutSearchFilter filter
 
int filter_role = 0
 
int filter_league = 0
 
int filter_min_age = 16
 
int filter_max_age = 40
 
int filter_min_overall = 0
 
int filter_max_value_m = 0
 
int filter_min_knowledge = 0
 
std::array< char, 48 > name_query {}
 
float name_settle_seconds = 0.0f
 
bool search_dirty = true
 
SearchColumn sort_column = SearchColumn::ABILITY
 
bool sort_ascending = false
 
UI::ColumnMask player_table_mask = ~UI::ColumnMask{0}
 
RecruitmentFocus focus_draft
 
int focus_role = 0
 
int focus_min_age = 17
 
int focus_max_age = 30
 
int focus_min_ability = 0
 
int64_t focus_max_fee = 0
 
int64_t focus_max_wage = 0
 
PlayerID selected_player = 0
 
std::string selected_name
 
Tab requested_tab
 
bool tab_pending = true
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Scouting and recruitment: scouts, assignments, reports, player search on estimated values, shortlist and recruitment focus.

The first tab is built around the scouts: clicking one opens his page with his live assignment and the reports he filed so far, his past assignments and their reports, or (when he has done nothing yet) the world picker to send him somewhere, with his expected effectiveness and its reasons.

Every figure about another club's player comes from the scouting estimates (GameController::getScoutedView / searchScoutedPlayers), never from the hidden true attributes. Rows are rebuilt on refresh or when a filter changes, never per frame.

Member Enumeration Documentation

◆ ReportColumn

enum class ScoutingScene::ReportColumn : uint8_t
strongprivate
Enumerator
PLAYER 
GRADE 
ABILITY 
POTENTIAL 
FEE 
DATE 

◆ SearchColumn

enum class ScoutingScene::SearchColumn : uint8_t
strongprivate
Enumerator
NAME 
CLUB 
ROLE 
AGE 
ABILITY 
POTENTIAL 
KNOWLEDGE 
VALUE 

◆ Tab

enum class ScoutingScene::Tab : uint8_t
strong

Tabs of the screen.

Enumerator
OVERVIEW 
REPORTS 
SEARCH 
SHORTLIST 
FOCUS 

Constructor & Destructor Documentation

◆ ScoutingScene()

ScoutingScene::ScoutingScene ( GUIView *  parent,
Tab  initialTab = Tab::OVERVIEW 
)
explicit

Member Function Documentation

◆ effectText()

std::string ScoutingScene::effectText ( const EffectFactor &  factor) const
private

◆ getID()

SceneID ScoutingScene::getID ( ) const
inlineoverridevirtual

Gets the ID of the scene.

Returns
The SceneID of this scene.

GUIView uses this identifier to apply match-specific event and scene behavior.

Implements GUIScene.

◆ makeLine()

ScoutingScene::PlayerLine ScoutingScene::makeLine ( const ScoutedPlayerRow &  row) const
private

◆ makeReportLine()

ScoutingScene::ReportLine ScoutingScene::makeReportLine ( const ScoutReport &  report) const
private

◆ navSection()

NavSection ScoutingScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ playerCell()

bool ScoutingScene::playerCell ( PlayerID  playerId,
const std::string &  name,
bool  selected 
)
private

◆ rebuildPlayerMatches()

void ScoutingScene::rebuildPlayerMatches ( )
private

◆ rebuildReports()

void ScoutingScene::rebuildReports ( )
private

◆ rebuildScoutDetail()

void ScoutingScene::rebuildScoutDetail ( )
private

◆ rebuildScoutReportList()

void ScoutingScene::rebuildScoutReportList ( )
private

◆ rebuildScouts()

void ScoutingScene::rebuildScouts ( )
private

◆ rebuildSearch()

void ScoutingScene::rebuildSearch ( )
private

◆ rebuildSendPreview()

void ScoutingScene::rebuildSendPreview ( )
private

◆ rebuildShortlist()

void ScoutingScene::rebuildShortlist ( )
private

◆ rebuildWorld()

void ScoutingScene::rebuildWorld ( )
private

◆ refresh()

void ScoutingScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderActiveAssignment()

void ScoutingScene::renderActiveAssignment ( const ScoutLine &  line)
private

◆ renderComparison()

void ScoutingScene::renderComparison ( )
private

◆ renderContent()

void ScoutingScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderFocus()

void ScoutingScene::renderFocus ( )
private

◆ renderFocusEditor()

void ScoutingScene::renderFocusEditor ( )
private

◆ renderOverview()

void ScoutingScene::renderOverview ( )
private

◆ renderPlayerActions()

void ScoutingScene::renderPlayerActions ( )
private

◆ renderPlayerTable()

void ScoutingScene::renderPlayerTable ( const char *  id,
std::vector< PlayerLine > &  lines,
float  height,
bool  sortable 
)
private

◆ renderReports()

void ScoutingScene::renderReports ( )
private

◆ renderScoutDetail()

void ScoutingScene::renderScoutDetail ( float  height)
private

◆ renderScoutHeader()

void ScoutingScene::renderScoutHeader ( const ScoutLine &  line) const
private

◆ renderScoutHistory()

void ScoutingScene::renderScoutHistory ( )
private

◆ renderScoutList()

void ScoutingScene::renderScoutList ( float  width,
float  height 
)
private

◆ renderScoutReports()

void ScoutingScene::renderScoutReports ( const char *  id,
float  height 
)
private

◆ renderSearch()

void ScoutingScene::renderSearch ( )
private

◆ renderSearchFilters()

void ScoutingScene::renderSearchFilters ( )
private

◆ renderSendFlow()

void ScoutingScene::renderSendFlow ( const ScoutLine &  line)
private

◆ renderSendSummary()

void ScoutingScene::renderSendSummary ( const ScoutLine &  line)
private

◆ renderShortlist()

void ScoutingScene::renderShortlist ( )
private

◆ renderWorldPicker()

void ScoutingScene::renderWorldPicker ( float  width,
float  height 
)
private

◆ selectedScoutLine()

const ScoutingScene::ScoutLine * ScoutingScene::selectedScoutLine ( ) const
private

◆ selectPlayer()

void ScoutingScene::selectPlayer ( PlayerID  playerId,
std::string_view  name 
)
private

◆ selectScout()

void ScoutingScene::selectScout ( uint32_t  scoutId)
private

◆ sendScout()

void ScoutingScene::sendScout ( ScoutTargetKind  kind,
uint32_t  targetId 
)
private

◆ sortScoutReports()

void ScoutingScene::sortScoutReports ( )
private

◆ sortSearch()

void ScoutingScene::sortSearch ( )
private

◆ targetLabel()

std::string ScoutingScene::targetLabel ( ScoutTargetKind  kind,
uint32_t  targetId 
) const
private

◆ update()

void ScoutingScene::update ( float  deltaTime)
overridevirtual

Updates scene logic.

Parameters
deltaTimeThe time elapsed since the last update.

Implements GUIScene.

Friends And Related Symbol Documentation

◆ GameFlowTest_GUIFlowLifecycle_Test

friend class GameFlowTest_GUIFlowLifecycle_Test
friend

Member Data Documentation

◆ comparison

std::vector<ComparisonLine> ScoutingScene::comparison
private

◆ effect_lines

std::vector<EffectLine> ScoutingScene::effect_lines
private

◆ expertise_lines

std::vector<std::string> ScoutingScene::expertise_lines
private

◆ filter

ScoutSearchFilter ScoutingScene::filter
private

◆ filter_league

int ScoutingScene::filter_league = 0
private

0 = all, 1 = free agents, else leagues[i-2].

◆ filter_max_age

int ScoutingScene::filter_max_age = 40
private

◆ filter_max_value_m

int ScoutingScene::filter_max_value_m = 0
private

Millions, 0 = any.

◆ filter_min_age

int ScoutingScene::filter_min_age = 16
private

◆ filter_min_knowledge

int ScoutingScene::filter_min_knowledge = 0
private

◆ filter_min_overall

int ScoutingScene::filter_min_overall = 0
private

◆ filter_role

int ScoutingScene::filter_role = 0
private

0 = any, else PlayerRole + 1.

◆ focus_draft

RecruitmentFocus ScoutingScene::focus_draft
private

◆ focus_max_age

int ScoutingScene::focus_max_age = 30
private

◆ focus_max_fee

int64_t ScoutingScene::focus_max_fee = 0
private

◆ focus_max_wage

int64_t ScoutingScene::focus_max_wage = 0
private

◆ focus_min_ability

int ScoutingScene::focus_min_ability = 0
private

◆ focus_min_age

int ScoutingScene::focus_min_age = 17
private

◆ focus_role

int ScoutingScene::focus_role = 0
private

◆ fresh_reports

std::vector<uint32_t> ScoutingScene::fresh_reports
private

◆ history_assignment

uint32_t ScoutingScene::history_assignment = 0
private

Past assignment shown, 0 = none.

◆ languages_full

std::string ScoutingScene::languages_full
private

◆ leagues

std::vector<std::pair<LeagueID, std::string> > ScoutingScene::leagues
private

◆ name_query

std::array<char, 48> ScoutingScene::name_query {}
private

◆ name_settle_seconds

float ScoutingScene::name_settle_seconds = 0.0f
private

Time left before an edited name filter re-runs the search.

◆ picker_multipliers

std::unordered_map<uint64_t, float> ScoutingScene::picker_multipliers
private

Effectiveness of the selected scout per picker entry (kind, id).

◆ player_matches

std::vector<std::pair<PlayerID, std::string> > ScoutingScene::player_matches
private

◆ player_query

std::array<char, 48> ScoutingScene::player_query {}
private

◆ player_table_mask

UI::ColumnMask ScoutingScene::player_table_mask = ~UI::ColumnMask{0}
private

Columns the player table showed last frame (for the column picker).

◆ report_sort

ReportColumn ScoutingScene::report_sort = ReportColumn::DATE
private

◆ report_sort_ascending

bool ScoutingScene::report_sort_ascending = false
private

◆ reports

std::vector<ReportLine> ScoutingScene::reports
private

◆ requested_tab

Tab ScoutingScene::requested_tab
private

◆ scout_history

std::vector<AssignmentLine> ScoutingScene::scout_history
private

◆ scout_lines

std::vector<ScoutLine> ScoutingScene::scout_lines
private

◆ scout_reports

std::vector<ReportLine> ScoutingScene::scout_reports
private

◆ scouts

std::vector<ScoutProfile> ScoutingScene::scouts
private

◆ search_dirty

bool ScoutingScene::search_dirty = true
private

◆ search_rows

std::vector<PlayerLine> ScoutingScene::search_rows
private

◆ selected_expertise

ScoutExpertise ScoutingScene::selected_expertise
private

◆ selected_name

std::string ScoutingScene::selected_name
private

◆ selected_player

PlayerID ScoutingScene::selected_player = 0
private

◆ selected_scout

uint32_t ScoutingScene::selected_scout = 0
private

◆ send_cost

int64_t ScoutingScene::send_cost = 0
private

◆ send_days

int ScoutingScene::send_days = 30
private

◆ send_dirty

bool ScoutingScene::send_dirty = true
private

◆ send_effect

ScoutEffectiveness ScoutingScene::send_effect
private

◆ send_kind

ScoutTargetKind ScoutingScene::send_kind = ScoutTargetKind::League
private

◆ send_open

bool ScoutingScene::send_open = false
private

◆ send_target

uint32_t ScoutingScene::send_target = 0
private

◆ send_target_text

std::string ScoutingScene::send_target_text
private

◆ shortlist_rows

std::vector<PlayerLine> ScoutingScene::shortlist_rows
private

◆ sort_ascending

bool ScoutingScene::sort_ascending = false
private

◆ sort_column

SearchColumn ScoutingScene::sort_column = SearchColumn::ABILITY
private

◆ tab_pending

bool ScoutingScene::tab_pending = true
private

◆ world

std::vector<ContinentNode> ScoutingScene::world
private

The documentation for this class was generated from the following files: