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

Class responsible for generating initial data for leagues, teams, and players. More...

#include <datagenerator.h>

Static Public Member Functions

static std::vector< League > generateLeagues ()
 Generate a collection of leagues.
 
static std::vector< Team > generateTeams ()
 Generate a collection of teams.
 
static std::unordered_map< TeamID, ClubIdentity > loadClubIdentities ()
 Reads short name, kit colours, stadium, founding year and nickname of every club in the data pack. Missing fields keep the ClubIdentity defaults, so minimal packs still load.
 
static std::unordered_map< std::string, std::string > loadClubArticles ()
 Reads the optional Italian article ("article_it": "la", "il", "lo" or "l'") of the clubs that set one, for ClubArticle.
 
static std::vector< Player > generatePlayers (const class GameData &gamedata)
 Loads the predefined players and completes every club's squad with generated players (see WorldGeneration). Club profiles must be assigned first; generation is deterministic for the world seed.
 

Detailed Description

Class responsible for generating initial data for leagues, teams, and players.

Member Function Documentation

◆ generateLeagues()

std::vector< League > DataGenerator::generateLeagues ( )
static

Generate a collection of leagues.

Returns
A vector of generated League objects.

◆ generatePlayers()

std::vector< Player > DataGenerator::generatePlayers ( const class GameData &  gamedata)
static

Loads the predefined players and completes every club's squad with generated players (see WorldGeneration). Club profiles must be assigned first; generation is deterministic for the world seed.

Returns
A vector of generated Player objects.

◆ generateTeams()

std::vector< Team > DataGenerator::generateTeams ( )
static

Generate a collection of teams.

Returns
A vector of generated Team objects.

◆ loadClubArticles()

std::unordered_map< std::string, std::string > DataGenerator::loadClubArticles ( )
static

Reads the optional Italian article ("article_it": "la", "il", "lo" or "l'") of the clubs that set one, for ClubArticle.

Returns
Articles keyed by club name.

◆ loadClubIdentities()

std::unordered_map< TeamID, ClubIdentity > DataGenerator::loadClubIdentities ( )
static

Reads short name, kit colours, stadium, founding year and nickname of every club in the data pack. Missing fields keep the ClubIdentity defaults, so minimal packs still load.

Returns
Identities keyed by team id.

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