main.cpp: struct App with one member function per presenter
main() held the whole window program in one function of about 4,300 lines: the state as locals and 53 presenters and services as lambdas capturing them. Now main() only sets up the game data, the window and the sound (40 statements) and runs App: - the objects main() created are reference members under their old names, - the state between the former lambdas are members, - every former top-level lambda is a member function, in the original order (present_season, show_tax, wait_sportschau_ack, present_live_lineup, service_family_table, ...), - App::run() holds the statements that stood between them: wiring of the hooks, title screen, event loop, tear-down. The code inside moved unchanged. Three hook variables that were initialised with a lambda are assigned in run(); five presenters that are passed on as values get a forwarding lambda. This makes the presenters addressable: the next steps move them into files of their own, which is also the seam for replacing screens one by one. Verified: robot (234 commands: title, new career, season start, every desk icon, two matchdays with the live match), UI walk, 9 careers identical; 211 of 211 tests. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
2173915d20
commit
71aeb7cc61
1 file changed
+3182
-2996
+3182
-2996
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user