Player12
An open source football management simulator
Loading...
Searching...
No Matches
draw_ceremony_dialog.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 <string>
14#include <vector>
15
16#include "global/types.h"
17#include "model/draw_ceremony.h"
18
19class GameController;
20class GUIView;
21
32{
33 public:
34 void open(const DrawCeremony& ceremony, const GameController& controller);
35 void render(GUIView* view);
36
37 [[nodiscard]] bool isOpen() const { return visible || open_requested; }
39 [[nodiscard]] std::size_t shownCount() const;
40 [[nodiscard]] std::size_t revealCount() const { return rows.size(); }
42 void revealAll() { skipped = true; }
43
44 private:
45 struct Row
46 {
49 std::string home;
50 std::string away;
51 std::string when;
52 std::string pot;
53 bool focus = false;
54 };
55
56 void renderRow(GUIView* view, const Row& row, std::size_t index, float alpha);
57
58 bool open_requested = false;
59 bool visible = false;
60 bool skipped = false;
61 float elapsed = 0.0f;
62 int speed_index = 0;
63 std::size_t last_shown = 0;
64 std::string title;
65 std::string subtitle;
66 bool league_phase = false;
67 std::vector<Row> rows;
68};
Modal that reveals a draw already made, one tie at a time.
Definition draw_ceremony_dialog.h:32
std::size_t last_shown
Definition draw_ceremony_dialog.h:63
void revealAll()
Definition draw_ceremony_dialog.h:42
void open(const DrawCeremony &ceremony, const GameController &controller)
Definition draw_ceremony_dialog.cpp:49
void renderRow(GUIView *view, const Row &row, std::size_t index, float alpha)
Definition draw_ceremony_dialog.cpp:97
void render(GUIView *view)
Definition draw_ceremony_dialog.cpp:168
bool open_requested
Definition draw_ceremony_dialog.h:58
std::vector< Row > rows
Definition draw_ceremony_dialog.h:67
std::string subtitle
Definition draw_ceremony_dialog.h:65
float elapsed
Definition draw_ceremony_dialog.h:61
std::size_t revealCount() const
Definition draw_ceremony_dialog.h:40
std::string title
Definition draw_ceremony_dialog.h:64
bool isOpen() const
Definition draw_ceremony_dialog.h:37
int speed_index
Definition draw_ceremony_dialog.h:62
bool skipped
Definition draw_ceremony_dialog.h:60
bool league_phase
Definition draw_ceremony_dialog.h:66
std::size_t shownCount() const
Definition draw_ceremony_dialog.cpp:89
bool visible
Definition draw_ceremony_dialog.h:59
Main view manager for the GUI. Handles scenes and overlays.
Definition gui_view.h:29
Manages the core game logic, interacting with teams, leagues, and players.
Definition game_controller.h:70
int index
Definition runtime_editor.cpp:94
Definition draw_ceremony_dialog.h:46
std::string home
Definition draw_ceremony_dialog.h:49
std::string pot
Definition draw_ceremony_dialog.h:52
TeamID away_id
Definition draw_ceremony_dialog.h:48
std::string away
Definition draw_ceremony_dialog.h:50
bool focus
Definition draw_ceremony_dialog.h:53
std::string when
Definition draw_ceremony_dialog.h:51
TeamID home_id
Definition draw_ceremony_dialog.h:47
A draw the game has already made, laid out for its ceremony.
Definition draw_ceremony.h:42
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18