Player12
An open source football management simulator
Loading...
Searching...
No Matches
holiday_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 <imgui.h>
12
13#include <optional>
14#include <string>
15#include <vector>
16
17#include "model/holiday.h"
18
19class GameController;
20
31{
32 public:
34 void open(GameController& controller);
35
37 void showSummary(const GameController& controller,
38 const HolidaySummary& summary);
39
41 std::optional<HolidayPlan> render(GameController& controller);
42
43 [[nodiscard]] bool isOpen() const { return visible; }
44
45 private:
46 struct Line
47 {
48 std::string text;
49 ImVec4 color;
50 };
51
52 std::optional<HolidayPlan> renderPlan(GameController& controller);
53 void renderSummary();
54 void refreshTarget(const GameController& controller);
55
56 bool open_requested = false;
57 bool visible = false;
58 bool showing_summary = false;
60 int mode = 0;
61 int bid_mode = 0;
62 std::int64_t bid_amount = 0;
63 int crisis_count = 5;
64 std::string target_text;
65 bool can_leave = false;
66
67 // Summary view, formatted once.
68 std::string summary_title;
69 std::string summary_reason;
71 std::vector<Line> results;
72 std::string table_line;
73 std::vector<std::pair<std::string, std::string>> money_rows;
74 std::vector<Line> moves;
75 std::vector<Line> injuries;
76 std::string filed_line;
77};
Manages the core game logic, interacting with teams, leagues, and players.
Definition game_controller.h:70
"Go on holiday" planner and the assistant's report on return.
Definition holiday_dialog.h:31
std::string target_text
Definition holiday_dialog.h:64
bool open_requested
Definition holiday_dialog.h:56
bool can_leave
Definition holiday_dialog.h:65
std::vector< std::pair< std::string, std::string > > money_rows
Definition holiday_dialog.h:73
bool showing_summary
Definition holiday_dialog.h:58
std::vector< Line > moves
Definition holiday_dialog.h:74
void renderSummary()
Definition holiday_dialog.cpp:308
void refreshTarget(const GameController &controller)
Definition holiday_dialog.cpp:60
std::string table_line
Definition holiday_dialog.h:72
int bid_mode
Definition holiday_dialog.h:61
std::int64_t bid_amount
Definition holiday_dialog.h:62
ImVec4 summary_reason_color
Definition holiday_dialog.h:70
std::optional< HolidayPlan > renderPlan(GameController &controller)
Definition holiday_dialog.cpp:195
std::optional< HolidayPlan > render(GameController &controller)
Definition holiday_dialog.cpp:155
int crisis_count
Definition holiday_dialog.h:63
std::string filed_line
Definition holiday_dialog.h:76
std::string summary_reason
Definition holiday_dialog.h:69
int mode
Definition holiday_dialog.h:60
HolidayPlan plan
Definition holiday_dialog.h:59
std::vector< Line > injuries
Definition holiday_dialog.h:75
void showSummary(const GameController &controller, const HolidaySummary &summary)
Definition holiday_dialog.cpp:82
bool visible
Definition holiday_dialog.h:57
void open(GameController &controller)
Definition holiday_dialog.cpp:44
std::string summary_title
Definition holiday_dialog.h:68
bool isOpen() const
Definition holiday_dialog.h:43
std::vector< Line > results
Definition holiday_dialog.h:71
Definition holiday_dialog.h:47
std::string text
Definition holiday_dialog.h:48
ImVec4 color
Definition holiday_dialog.h:49
A holiday request.
Definition holiday.h:67
The assistant's report when the manager returns.
Definition holiday.h:128