Player12
An open source football management simulator
Loading...
Searching...
No Matches
datagenerator.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// Football Management Project
3// Copyright (c) 2025 - 2026 Flavio Milinanni. All Rights Reserved.
4//
5// This file is part of the Football Management Project.
6// See the LICENSE file in the project root.
7// -----------------------------------------------------------------------------
8
9#pragma once
10
11#include <cstdint>
12#include <string>
13#include <unordered_map>
14#include <vector>
15
16#include "league.h"
17#include "player.h"
18#include "team.h"
19
29{
30 std::string short_name;
31 std::uint32_t primary_colour = 0xFFFFFF;
32 std::uint32_t secondary_colour = 0x1A1A1A;
33 std::string stadium_name;
34 std::uint32_t stadium_capacity = 0;
35 std::uint16_t founded = 0;
36 std::string nickname;
37};
38
45{
46 public:
51 static std::vector<League> generateLeagues();
52
57 static std::vector<Team> generateTeams();
58
65 static std::unordered_map<TeamID, ClubIdentity> loadClubIdentities();
66
72 static std::unordered_map<std::string, std::string> loadClubArticles();
73
80 static std::vector<Player> generatePlayers(const class GameData& gamedata);
81};
Class responsible for generating initial data for leagues, teams, and players.
Definition datagenerator.h:45
static std::vector< League > generateLeagues()
Generate a collection of leagues.
Definition datagenerator.cpp:69
static std::unordered_map< TeamID, ClubIdentity > loadClubIdentities()
Reads short name, kit colours, stadium, founding year and nickname of every club in the data pack....
Definition datagenerator.cpp:111
static std::vector< Player > generatePlayers(const class GameData &gamedata)
Loads the predefined players and completes every club's squad with generated players (see WorldGenera...
Definition datagenerator.cpp:155
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...
Definition datagenerator.cpp:140
static std::vector< Team > generateTeams()
Generate a collection of teams.
Definition datagenerator.cpp:96
Singleton class that acts as an in-memory cache for the database state.
Definition gamedata.h:43
Descriptive club data read from the team files of the data pack.
Definition datagenerator.h:29
std::uint32_t stadium_capacity
Definition datagenerator.h:34
std::uint32_t secondary_colour
Definition datagenerator.h:32
std::string short_name
Definition datagenerator.h:30
std::string nickname
Definition datagenerator.h:36
std::uint16_t founded
Definition datagenerator.h:35
std::uint32_t primary_colour
Definition datagenerator.h:31
std::string stadium_name
Definition datagenerator.h:33