|
Player12
An open source football management simulator
|
#include <match_scene.h>
Classes | |
| struct | LineupProblem |
Public Member Functions | |
| MatchScene (class GUIView *guiView_ptr, uint16_t home_id, uint16_t away_id) | |
| void | onEnter () override |
| Called when the scene is entered/becomes active. | |
| void | handleEvent (const SDL_Event &event) override |
| Handles SDL events for the scene. | |
| void | update (float deltaTime) override |
| Updates scene logic. | |
| void | render () override |
| Renders the scene. | |
| void | onExit () override |
| Called when the scene is exited/becomes inactive. | |
| SceneID | getID () const override |
| Gets the ID of the scene. | |
Public Member Functions inherited from GUIScene | |
| GUIScene (GUIView *guiView_ptr) | |
| Constructs a new GUIScene. | |
| virtual | ~GUIScene ()=default |
| Destroys the GUIScene. | |
| virtual void | onResume () |
| Called when an overlay above this scene closes and it becomes the active scene again. Screens use it to refresh cached view models after a match, a transfer or any other state change made elsewhere. | |
| virtual void | onResize (int width, int height) |
| Called when the window is resized. | |
| virtual std::optional< NavEntry > | historyEntry () const |
| How to open this screen again from the navigation history, or nothing for scenes outside it (menus, team selection, the live match). | |
Private Types | |
| enum class | PlayMenuNext : std::uint8_t { NONE , TACTICS , SUBSTITUTIONS } |
Static Private Attributes | |
| static bool | assistant_substitutions = false |
Additional Inherited Members | |
Protected Member Functions inherited from GUIScene | |
| SDL_Renderer * | getRenderer () const |
| Gets the SDL renderer. | |
| SDL_Window * | getWindow () const |
| Gets the SDL window. | |
| GUIView * | getGuiView () const |
| Gets the associated GUIView. | |
| void | changeScene (std::unique_ptr< GUIScene > newScene) |
| Requests a scene change. | |
| void | quit () |
| Requests the application to quit. | |
Protected Attributes inherited from GUIScene | |
| GUIView * | guiView |
Live match of the managed club (or any two clubs for tooling).
Before kick-off the managed selection is validated for the fixture: an injured or suspended player blocks the match until the lineup is fixed (auto-fix or the lineup screen). The engine then starts with every player's persistent condition, the AI substitutes only for the opponent unless the manager lets the assistant handle changes, and the finished match is recorded with its full engine report and consequences.
Play mode: the manager can play his club's match himself (Play, or Take control while watching), driving one footballer at a time on the same simulation (see MatchPlayController), and hand it back to the AI at a stoppage or from the pause menu.
|
strongprivate |
| MatchScene::MatchScene | ( | class GUIView * | guiView_ptr, |
| uint16_t | home_id, | ||
| uint16_t | away_id | ||
| ) |
|
private |
Lets the assistant replace unavailable players (notes the changes).
|
private |
AI substitutions: opponent always, managed side only via assistant.
|
private |
At a stoppage or while paused the AI can take the team back.
|
private |
The managed club's live match can be taken over now.
|
private |
|
private |
|
private |
Resumes play once no matchday dialog is left open.
|
private |
Records the result with the full engine report and shows the report.
|
overridevirtual |
|
private |
|
overridevirtual |
Handles SDL events for the scene.
| event | The SDL event to process. |
Reimplemented from GUIScene.
|
private |
Orbit, pan, zoom and double-click over the view (last item).
|
overridevirtual |
Called when the scene is entered/becomes active.
Reimplemented from GUIScene.
|
overridevirtual |
Called when the scene is exited/becomes inactive.
Reimplemented from GUIScene.
|
private |
|
private |
Pauses the managed club's match when it has just reached a break.
|
private |
|
private |
Zoomed 2D viewport following the ball and the active footballer.
|
private |
Plays the rest of the match instantly, then finishes it.
|
private |
Re-checks the managed selection against today's fixture.
|
private |
Appends new engine events to the (optionally filtered) feed.
|
overridevirtual |
Renders the scene.
Implements GUIScene.
|
private |
|
private |
|
private |
|
private |
Shouts chip in the bottom-right corner of the focus view.
|
private |
|
private |
|
private |
The view with the shouts bar under it (managed matches).
|
private |
|
private |
Play / Take control / Hand back / Menu buttons (one row).
|
private |
|
private |
Keyboard and gamepad layout, as text rows.
|
private |
|
private |
Marker, labels, power bar and radar over the view; stick mapping.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Pauses and asks for confirmation before control is taken.
|
private |
|
private |
|
private |
|
private |
Enters or leaves pitch focus (full-window view with overlay HUD).
|
private |
|
private |
|
private |
|
private |
Shows or hides a matchday dialog (pausing play if the user wants).
|
private |
|
private |
Builds the engine once the selection is valid.
|
private |
Hands the managed side's active footballer to the human.
Performs a manual change now; false (with a reason) when refused.
|
private |
ImGui keyboard navigation off while the keys drive the pitch.
|
private |
Hands the 3D view to the free camera from the pose on screen.
|
private |
|
private |
Toggles the real window between windowed and full screen.
|
private |
The managed side's touchline (only when the managed club plays).
|
overridevirtual |
Updates scene logic.
| deltaTime | The time elapsed since the last update. |
Implements GUIScene.
|
private |
Device input and switching before the engine advances.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
inlinestaticprivate |
Substitutions for the managed side (off: only the manager's). The lineup assistant lives in the game (GameController).
|
private |
Crowd, whistle and ball sounds of the live match.
|
private |
|
private |
|
private |
|
private |
|
private |
Daylight 3D presentation (default for day kick-offs).
|
private |
|
private |
"a.e.t." / "4-3 on penalties" under the full-time score (built once).
|
private |
|
private |
|
private |
Type of today's calendar fixture between the teams, if there is one.
|
private |
Weekday, date and kick-off of that fixture ("Sun 17 Aug 20:45").
|
private |
Width of the focus HUD's control strip last frame (right-aligned).
|
private |
|
private |
The free camera orbits the moving ball (B).
|
private |
|
private |
|
private |
|
private |
The match was in a break (half-time, around extra time, shootout) last frame: entering one pauses the managed club's match.
|
private |
|
private |
|
private |
|
private |
Kick-off of today's fixture (minutes after midnight, -1 unknown).
|
private |
|
private |
|
private |
|
private |
|
private |
Side of the managed club, if it plays in this match.
|
private |
|
private |
Multiplier of the engine's real-time pace (1x = real time).
|
private |
|
private |
ImGui keyboard navigation is off while the keys drive the pitch.
|
private |
Play was paused by opening a matchday dialog (resumes on close).
|
private |
Mouse input over the 3D view waiting for the next rendered frame.
|
private |
|
private |
"Pitch focus": the view fills the window under a compact HUD (F).
|
private |
Devices, buttons and the active footballer of the human's side.
|
private |
Stick-to-pitch mapping of the view on screen (last frame).
|
private |
"Take control" asked: the paused match waits on the confirmation.
|
private |
Damped centre of the zoomed 2D play view (normalised pitch).
|
private |
|
private |
The play-mode pause menu is open.
|
private |
|
private |
The pause control was pressed again with the menu open: it closes (from inside the popup) and play resumes.
|
private |
What the assistant changed before kick-off, shown in the HUD.
|
private |
Pitch-control overlay on the 2D view.
|
private |
|
private |
Quick result running on a worker thread (declared after the engine so it is joined before the engine is destroyed).
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Statistics and events hidden so the view gets the whole width.
|
private |
Seconds the "skipping to the next highlight" note stays visible.
|
private |
The last update skipped ahead: the next frame's time (which includes the skip's own work) is clamped so play does not jump.
|
private |
|
private |
Render snapshot refilled every frame (no per-frame allocation).
|
private |
Substitutions dialog: planned changes, swaps and the assistant.
|
private |
|
private |
|
private |
Tactics dialog: style, instructions and formation during play.
|
private |
|
private |
|
private |
Feed rows: indices into the engine's events (key moments by default).
|
private |
|
private |
|
private |
|
private |
How the match was being watched, restored on hand-back.