Player12
An open source football management simulator
Loading...
Searching...
No Matches
strategy_scene.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#include <imgui.h>
11
13#include "model/lineup.h"
14#include "model/strategy.h"
15
25{
26 public:
31 explicit StrategyScene(GUIView* parent);
32
36 ~StrategyScene() override = default;
37
42 void update(float deltaTime) override;
43
48 [[nodiscard]] SceneID getID() const override;
49
50 protected:
51 void renderContent() override;
52 [[nodiscard]] NavSection navSection() const override
53 {
55 }
56 void refresh() override { loadStrategy(); }
57
58 private:
60
62 static constexpr int KEEPER_SLOT = -1;
63
64 void renderInstructions(float width);
65 void renderSummary(float width) const;
66 void renderRoles(float width);
67 void renderShapeEditor(const Lineup& lineup, float width);
68 void renderSlotList(const Lineup& lineup);
69 void renderSlotDetails(const Lineup& lineup);
70 void renderShapePresets(const Lineup& lineup, float width);
71
73 [[nodiscard]] Strategy* clubStrategy() const;
74 [[nodiscard]] const Lineup* clubLineup() const;
76 [[nodiscard]] SlotInstruction slotAt(const Lineup& lineup, int slot) const;
77 void storeSlot(const SlotInstruction& instruction) const;
78 void setRole(const Lineup& lineup, TacticalRole role);
79 void setDuty(const Lineup& lineup, RoleDuty duty);
80 void applyShape(const Lineup& lineup, PossessionShape shape);
81 void suggestRoles(const Lineup& lineup);
82 void applySliders() const;
83
85 [[nodiscard]] bool changedSinceEntry() const;
86 void revert();
87 void loadStrategy();
88
95 int dragging_slot = -1;
96};
Main view manager for the GUI. Handles scenes and overlays.
Definition gui_view.h:29
Manages the starting XI and reserves of a team.
Definition lineup.h:85
Base class for every in-career screen.
Definition management_scene.h:93
The managed club's tactics: style and instructions, player roles and duties, and the shape with the b...
Definition strategy_scene.h:25
const Lineup * clubLineup() const
Definition strategy_scene.cpp:284
void renderContent() override
Draws the page body inside the content region.
Definition strategy_scene.cpp:258
void setRole(const Lineup &lineup, TacticalRole role)
Definition strategy_scene.cpp:725
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition strategy_scene.h:52
void renderSlotList(const Lineup &lineup)
Definition strategy_scene.cpp:671
~StrategyScene() override=default
Destroys the StrategyScene.
static constexpr int KEEPER_SLOT
Definition strategy_scene.h:62
void renderSlotDetails(const Lineup &lineup)
Definition strategy_scene.cpp:584
void revert()
Definition strategy_scene.cpp:793
void renderSummary(float width) const
Definition strategy_scene.cpp:346
int selected_preset
Definition strategy_scene.h:92
void applyShape(const Lineup &lineup, PossessionShape shape)
Definition strategy_scene.cpp:745
SlotInstruction slotAt(const Lineup &lineup, int slot) const
Definition strategy_scene.cpp:417
void refresh() override
Rebuilds cached view models from the game state.
Definition strategy_scene.h:56
bool changedSinceEntry() const
Definition strategy_scene.cpp:783
void renderInstructions(float width)
Definition strategy_scene.cpp:290
SceneID getID() const override
Gets the ID of this scene.
Definition strategy_scene.cpp:822
void loadStrategy()
Definition strategy_scene.cpp:803
void setDuty(const Lineup &lineup, RoleDuty duty)
Definition strategy_scene.cpp:737
void suggestRoles(const Lineup &lineup)
Definition strategy_scene.cpp:757
void applySliders() const
Definition strategy_scene.cpp:777
void renderShapeEditor(const Lineup &lineup, float width)
Definition strategy_scene.cpp:444
int dragging_slot
Definition strategy_scene.h:95
void renderRoles(float width)
Definition strategy_scene.cpp:373
void renderShapePresets(const Lineup &lineup, float width)
Definition strategy_scene.cpp:542
void storeSlot(const SlotInstruction &instruction) const
Definition strategy_scene.cpp:439
void update(float deltaTime) override
Updates scene logic.
Definition strategy_scene.cpp:256
StrategySliders current_sliders
Definition strategy_scene.h:89
Strategy entry_strategy
Definition strategy_scene.h:91
Strategy * clubStrategy() const
Definition strategy_scene.cpp:278
int selected_slot
Definition strategy_scene.h:93
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition strategy_scene.h:59
Represents the tactical setup of a team for a match.
Definition strategy.h:61
SceneID
Identifiers for different GUI scenes.
Definition gui_scene.h:24
NavSection
Screens of the management shell. The sidebar groups them into a few hubs (Home, Inbox,...
Definition nav_history.h:26
Role, duty and in-possession spot of one outfield slot. Slots are matched by their out-of-possession ...
Definition tactics.h:126
Team-wide tactical preferences in [0, 1].
Definition strategy.h:27
RoleDuty
Attacking commitment of a role (persisted in the tactic).
Definition tactics.h:65
TacticalRole
How a player interprets his slot (values are persisted in the tactic). Standard plays the position as...
Definition tactics.h:43
PossessionShape
Ready-made in-possession shapes offered on the tactics screen.
Definition tactics.h:143