refactor: replace Tutorial::staticCtor with ITutorial::staticInit in Minecraft.cpp

This commit is contained in:
MatthewBeshay 2026-04-09 22:27:26 +10:00
parent 514c75bf01
commit 41d139ce32
3 changed files with 9 additions and 2 deletions

View file

@ -72,6 +72,8 @@ bool Tutorial::PopupMessageDetails::isSameContent(PopupMessageDetails* other) {
return textTheSame && titleTheSame && promptTheSame; return textTheSame && titleTheSame && promptTheSame;
} }
void ITutorial::staticInit() { Tutorial::staticCtor(); }
void Tutorial::staticCtor() { void Tutorial::staticCtor() {
// //
/* /*

View file

@ -17,7 +17,7 @@
#include "Timer.h" #include "Timer.h"
#include "User.h" #include "User.h"
#include "app/common/Audio/SoundEngine.h" #include "app/common/Audio/SoundEngine.h"
#include "app/common/Tutorial/Tutorial.h" #include "minecraft/world/tutorial/ITutorial.h"
#include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h" #include "app/common/UI/All Platforms/UIStructs.h"
#include "app/linux/Linux_UIController.h" #include "app/linux/Linux_UIController.h"
@ -4207,7 +4207,7 @@ void Minecraft::main(IPlatformLeaderboard& leaderboard) {
EntityRenderDispatcher::staticCtor(); EntityRenderDispatcher::staticCtor();
TileEntityRenderDispatcher::staticCtor(); TileEntityRenderDispatcher::staticCtor();
User::staticCtor(); User::staticCtor();
Tutorial::staticCtor(); ITutorial::staticInit();
ColourTable::staticCtor(); ColourTable::staticCtor();
gameServices().loadDefaultGameRules(); gameServices().loadDefaultGameRules();

View file

@ -23,6 +23,11 @@ class ITutorial {
public: public:
virtual ~ITutorial() = default; virtual ~ITutorial() = default;
// One-time process-wide initialisation. The concrete tutorial
// implementation in app/common/Tutorial/Tutorial.cpp provides the
// body. Called once from Minecraft::staticCtor.
static void staticInit();
[[nodiscard]] virtual bool isStateCompleted(eTutorial_State state) = 0; [[nodiscard]] virtual bool isStateCompleted(eTutorial_State state) = 0;
virtual void changeTutorialState(eTutorial_State newState) = 0; virtual void changeTutorialState(eTutorial_State newState) = 0;