|
Player12
An open source football management simulator
|
Represents a football team. More...
#include <team.h>
Public Member Functions | |
| Team (TeamID team_id, uint8_t team_league_id, std::string_view team_name, int64_t initial_balance, const std::vector< PlayerID > &initial_player_ids={}, const Strategy &strategy=Strategy{}, const Lineup &lineup_data=Lineup{}) | |
| Constructs a Team object. | |
| TeamID | getId () const |
| Gets the team's ID. | |
| LeagueID | getLeagueId () const |
| Gets the ID of the team's league. | |
| void | setLeagueId (LeagueID new_league_id) |
| Moves the team to another league (promotion/relegation). | |
| const std::string & | getName () const |
| Gets the name of the team. | |
| const std::vector< PlayerID > & | getPlayerIDs () const |
| Player IDs of the senior squad (academy players excluded). | |
| const std::vector< PlayerID > & | getAcademyIDs () const |
| Player IDs of the club's academy (U18 squad and trialists). | |
| void | addPlayerID (PlayerID id) |
| Adds a player to the team. | |
| void | addAcademyID (PlayerID id) |
| Adds a player to the club's academy. | |
| void | setAcademyMember (PlayerID id, bool academy) |
| Moves a club player between the senior squad and the academy (use GameData::setAcademyMember, which keeps the player's flag too). | |
| bool | removePlayerID (PlayerID id) |
| Removes a player from the team (senior squad or academy). | |
| Lineup & | getLineup () |
| Gets the team's lineup (non-const). | |
| const Lineup & | getLineup () const |
| Gets the team's lineup (const). | |
| Strategy & | getStrategy () |
| Gets the team's strategy (non-const). | |
| const Strategy & | getStrategy () const |
| Gets the team's strategy (const). | |
| void | setStrategy (const Strategy &strategy) |
| Sets the team's strategy. | |
| void | generateStartingXI (const class GameData &gamedata, const StatsConfig &stats_config) |
| Generates the best starting XI automatically based on stats. | |
| Finances & | getFinances () noexcept |
| Gets the team's finances (non-const). | |
| const Finances & | getFinances () const noexcept |
| Gets the team's finances (const). | |
| const ClubProfile & | getProfile () const noexcept |
| Reputation, stadium, ticket price and facilities. | |
| void | setProfile (const ClubProfile &profile) |
| Replaces the club profile. | |
| std::uint8_t | getReputation () const noexcept |
| Club reputation (1-100). | |
| std::uint32_t | getStadiumCapacity () const noexcept |
| Stadium capacity in seats. | |
| const std::string & | getRecentForm () const noexcept |
| Last results, newest first ("WDL..."), at most 5 letters. | |
| void | setRecentForm (std::string_view form) |
| Restores the recent-form string (persistence). | |
| void | pushResult (MatchOutcome outcome) |
| Prepends a result to the recent form. | |
Private Attributes | |
| TeamID | id |
| LeagueID | league_id |
| std::string | name |
| std::vector< PlayerID > | player_ids |
| std::vector< PlayerID > | academy_ids |
| Strategy | team_strategy |
| Lineup | lineup |
| Finances | finances |
| ClubProfile | profile |
| std::string | recent_form |
Represents a football team.
| Team::Team | ( | TeamID | team_id, |
| uint8_t | team_league_id, | ||
| std::string_view | team_name, | ||
| int64_t | initial_balance, | ||
| const std::vector< PlayerID > & | initial_player_ids = {}, |
||
| const Strategy & | strategy = Strategy{}, |
||
| const Lineup & | lineup_data = Lineup{} |
||
| ) |
Constructs a Team object.
| team_id | The unique ID for the team. |
| team_league_id | The ID of the league the team belongs to. |
| team_name | The name of the team. |
| initial_balance | The initial financial balance. |
| initial_player_ids | Optional list of initial player IDs. |
| strategy | Optional strategy for the team. |
| lineup_data | Optional lineup data for the team. |
| void Team::addAcademyID | ( | PlayerID | id | ) |
Adds a player to the club's academy.
| void Team::addPlayerID | ( | PlayerID | id | ) |
Adds a player to the team.
| id | The player's ID. |
| void Team::generateStartingXI | ( | const class GameData & | gamedata, |
| const StatsConfig & | stats_config | ||
| ) |
Generates the best starting XI automatically based on stats.
Injured players are left out.
| stats_config | The configuration used to evaluate players. |
| const std::vector< PlayerID > & Team::getAcademyIDs | ( | ) | const |
Player IDs of the club's academy (U18 squad and trialists).
|
noexcept |
Gets the team's finances (const).
|
noexcept |
Gets the team's finances (non-const).
| uint16_t Team::getId | ( | ) | const |
Gets the team's ID.
| uint8_t Team::getLeagueId | ( | ) | const |
Gets the ID of the team's league.
| Lineup & Team::getLineup | ( | ) |
Gets the team's lineup (non-const).
| const Lineup & Team::getLineup | ( | ) | const |
Gets the team's lineup (const).
| const std::string & Team::getName | ( | ) | const |
Gets the name of the team.
| const std::vector< PlayerID > & Team::getPlayerIDs | ( | ) | const |
Player IDs of the senior squad (academy players excluded).
|
noexcept |
Reputation, stadium, ticket price and facilities.
|
noexcept |
Last results, newest first ("WDL..."), at most 5 letters.
|
noexcept |
Club reputation (1-100).
|
noexcept |
Stadium capacity in seats.
| Strategy & Team::getStrategy | ( | ) |
Gets the team's strategy (non-const).
| const Strategy & Team::getStrategy | ( | ) | const |
Gets the team's strategy (const).
| void Team::pushResult | ( | MatchOutcome | outcome | ) |
Prepends a result to the recent form.
| bool Team::removePlayerID | ( | PlayerID | id | ) |
Removes a player from the team (senior squad or academy).
| id | The player's ID. |
| void Team::setAcademyMember | ( | PlayerID | id, |
| bool | academy | ||
| ) |
Moves a club player between the senior squad and the academy (use GameData::setAcademyMember, which keeps the player's flag too).
| void Team::setLeagueId | ( | LeagueID | new_league_id | ) |
Moves the team to another league (promotion/relegation).
| void Team::setProfile | ( | const ClubProfile & | profile | ) |
Replaces the club profile.
| void Team::setRecentForm | ( | std::string_view | form | ) |
Restores the recent-form string (persistence).
| void Team::setStrategy | ( | const Strategy & | strategy | ) |
Sets the team's strategy.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |