Player12
An open source football management simulator
Loading...
Searching...
No Matches
draw_ceremony.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 <cstddef>
12#include <cstdint>
13#include <optional>
14#include <string>
15#include <vector>
16
17#include "global/types.h"
18#include "model/continental.h"
19#include "model/gamedate.h"
20
21class Calendar;
22class GameData;
23struct InboxMessage;
24
27{
31 std::optional<GameDateValue> second_leg;
32 std::uint8_t pot = 0;
33};
34
42{
43 enum class Kind : std::uint8_t
44 {
48 };
49
53 std::uint8_t stage = 0;
54 std::string competition_name;
55 std::string round_name;
60 std::vector<DrawReveal> reveals;
61};
62
72{
74inline constexpr float REVEAL_SECONDS = 0.9f;
75
77std::optional<DrawCeremony> cupRound(const Calendar& calendar,
78 const GameData& gamedata, LeagueID root,
79 std::uint8_t stage, TeamID focus_team);
80
82std::optional<DrawCeremony> latestCupRound(const Calendar& calendar,
83 const GameData& gamedata,
84 LeagueID root,
85 const GameDateValue& today,
86 TeamID focus_team);
87
93std::optional<DrawCeremony> continentalRound(
94 const ContinentalCompetitions& continental, const Calendar& calendar,
95 LeagueID competition_id, std::uint16_t season_year,
96 Continental::Round round, TeamID focus_team);
97
99std::optional<DrawCeremony> latestContinentalRound(
100 const ContinentalCompetitions& continental, const Calendar& calendar,
101 LeagueID competition_id, const GameDateValue& today, TeamID focus_team);
102
104bool announcesDraw(const InboxMessage& message);
105
110std::optional<DrawCeremony> forMessage(
111 const InboxMessage& message, const ContinentalCompetitions& continental,
112 const Calendar& calendar, TeamID focus_team);
113
118std::size_t shownAt(float elapsed, float speed, std::size_t total,
119 bool reduced_motion);
120} // namespace DrawCeremonies
Manages the match calendar for a season.
Definition calendar.h:133
Seasons, draws, knockouts, prize money and coefficients of the continental club competitions.
Definition continental.h:238
Singleton class that acts as an in-memory cache for the database state.
Definition gamedata.h:43
Round
Definition continental.h:55
Builds draw ceremonies from draws already made.
Definition draw_ceremony.h:72
std::size_t shownAt(float elapsed, float speed, std::size_t total, bool reduced_motion)
Definition draw_ceremony.cpp:318
bool announcesDraw(const InboxMessage &message)
Definition draw_ceremony.cpp:280
std::optional< DrawCeremony > cupRound(const Calendar &calendar, const GameData &gamedata, LeagueID root, std::uint8_t stage, TeamID focus_team)
Definition draw_ceremony.cpp:175
std::optional< DrawCeremony > latestCupRound(const Calendar &calendar, const GameData &gamedata, LeagueID root, const GameDateValue &today, TeamID focus_team)
Definition draw_ceremony.cpp:210
std::optional< DrawCeremony > forMessage(const InboxMessage &message, const ContinentalCompetitions &continental, const Calendar &calendar, TeamID focus_team)
Definition draw_ceremony.cpp:286
std::optional< DrawCeremony > latestContinentalRound(const ContinentalCompetitions &continental, const Calendar &calendar, LeagueID competition_id, const GameDateValue &today, TeamID focus_team)
Definition draw_ceremony.cpp:263
std::optional< DrawCeremony > continentalRound(const ContinentalCompetitions &continental, const Calendar &calendar, LeagueID competition_id, std::uint16_t season_year, Continental::Round round, TeamID focus_team)
Definition draw_ceremony.cpp:229
constexpr float REVEAL_SECONDS
Definition draw_ceremony.h:74
A draw the game has already made, laid out for its ceremony.
Definition draw_ceremony.h:42
Kind
Definition draw_ceremony.h:44
GameDateValue drawn_on
Definition draw_ceremony.h:56
std::uint8_t stage
Definition draw_ceremony.h:53
std::vector< DrawReveal > reveals
Definition draw_ceremony.h:60
Kind kind
Definition draw_ceremony.h:50
TeamID focus_team
Definition draw_ceremony.h:59
LeagueID competition_id
Definition draw_ceremony.h:51
std::string round_name
Definition draw_ceremony.h:55
std::string competition_name
Definition draw_ceremony.h:54
One tie (or one league-phase opponent) shown by a draw ceremony.
Definition draw_ceremony.h:27
std::optional< GameDateValue > second_leg
Definition draw_ceremony.h:31
std::uint8_t pot
Definition draw_ceremony.h:32
TeamID away_id
Definition draw_ceremony.h:29
GameDateValue date
Definition draw_ceremony.h:30
TeamID home_id
Definition draw_ceremony.h:28
Represents a specific date in the game world.
Definition gamedate.h:20
A news item for the managed club.
Definition inbox.h:84
uint8_t LeagueID
Type alias for League identifiers.
Definition types.h:15
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18