Player12
An open source football management simulator
Loading...
Searching...
No Matches
squad_planner.h File Reference
#include <array>
#include <cstddef>
#include <cstdint>
#include <utility>
#include <vector>
#include "global/types.h"

Go to the source code of this file.

Classes

struct  PlannerPlayer
 What the planner knows about one player of the squad. More...
 
struct  DepthEntry
 One player's line in the depth chart of the viewed season. More...
 
struct  GroupDepth
 Depth of one position group. More...
 
struct  PlannerNeed
 
struct  ContractExpiry
 Players whose contract ends in a given season. More...
 
struct  SquadPlan
 Depth chart, needs, age profile and contract calendar of a squad for the current season (offset 0) or a projected later one. More...
 

Namespaces

namespace  SquadPlanner
 

Enumerations

enum class  PlannerGroup : std::uint8_t {
  Goalkeeper , CentreBack , LeftBack , RightBack ,
  Midfield , Wide , Striker , COUNT
}
 Position groups of the depth chart (the groups computer-managed clubs count when they look for missing or surplus players). More...
 
enum class  DepthTier : std::uint8_t { FirstChoice , Backup , Prospect }
 Place of a player in his group's depth chart. More...
 
enum class  NeedKind : std::uint8_t { Missing , Upgrade , Succession , Surplus }
 Why the planner suggests recruitment (or a sale) for a group. More...
 

Functions

PlannerGroup SquadPlanner::groupOf (PlayerRole role)
 
const char * SquadPlanner::groupKey (PlannerGroup group)
 
int SquadPlanner::targetDepth (PlannerGroup group)
 
int SquadPlanner::defaultStarters (PlannerGroup group)
 
PlannerPlayer SquadPlanner::project (const PlannerPlayer &player, int seasons)
 
SquadPlan SquadPlanner::build (const std::vector< PlannerPlayer > &squad, int season_offset, const std::array< int, PLANNER_GROUP_COUNT > &starters={})
 

Variables

constexpr std::size_t PLANNER_GROUP_COUNT
 
constexpr std::array< int, 4 > AGE_BAND_LIMITS = {21, 25, 29, 32}
 Age bands of the age profile.
 
constexpr std::size_t AGE_BAND_COUNT = AGE_BAND_LIMITS.size() + 1
 

Enumeration Type Documentation

◆ DepthTier

enum class DepthTier : std::uint8_t
strong

Place of a player in his group's depth chart.

Enumerator
FirstChoice 
Backup 
Prospect 

Young player behind the first choices.

◆ NeedKind

enum class NeedKind : std::uint8_t
strong

Why the planner suggests recruitment (or a sale) for a group.

Enumerator
Missing 

Fewer players than the healthy depth.

Upgrade 

First choices clearly weaker than the rest of the XI.

Succession 

A first choice is ageing or his contract runs out.

Surplus 

Two or more players more than needed.

◆ PlannerGroup

enum class PlannerGroup : std::uint8_t
strong

Position groups of the depth chart (the groups computer-managed clubs count when they look for missing or surplus players).

Enumerator
Goalkeeper 
CentreBack 
LeftBack 
RightBack 
Midfield 

Defensive, central and attacking midfielders.

Wide 

Wide midfielders and wingers.

Striker 
COUNT 

Variable Documentation

◆ AGE_BAND_COUNT

constexpr std::size_t AGE_BAND_COUNT = AGE_BAND_LIMITS.size() + 1
inlineconstexpr

◆ AGE_BAND_LIMITS

constexpr std::array<int, 4> AGE_BAND_LIMITS = {21, 25, 29, 32}
inlineconstexpr

Age bands of the age profile.

◆ PLANNER_GROUP_COUNT

constexpr std::size_t PLANNER_GROUP_COUNT
inlineconstexpr
Initial value:
=
static_cast<std::size_t>(std::to_underlying(PlannerGroup::COUNT))