From 236ed0a180029f07e93c00f4fdeca6739c796305 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Mon, 1 Jun 2026 21:59:07 +0200 Subject: [PATCH] refactor: consistent isActive() guard on tutorial onCommand; tidy App imports --- Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java | 4 ++-- .../src/main/java/thb/jeanluc/adventure/game/Game.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java index ff6367d..70daa3d 100644 --- a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java +++ b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/App.java @@ -22,14 +22,14 @@ import thb.jeanluc.adventure.game.Game; import thb.jeanluc.adventure.game.GameContext; import thb.jeanluc.adventure.game.GameSession; import thb.jeanluc.adventure.game.TutorialGuide; -import thb.jeanluc.adventure.loader.TutorialLoader; -import thb.jeanluc.adventure.model.Tutorial; import thb.jeanluc.adventure.io.ConsoleIO; import thb.jeanluc.adventure.io.GameIO; import thb.jeanluc.adventure.io.text.Banner; +import thb.jeanluc.adventure.loader.TutorialLoader; import thb.jeanluc.adventure.loader.WorldLoader; import thb.jeanluc.adventure.menu.MainMenu; import thb.jeanluc.adventure.menu.SettingsMenu; +import thb.jeanluc.adventure.model.Tutorial; import thb.jeanluc.adventure.save.SaveException; import thb.jeanluc.adventure.save.SaveService; import thb.jeanluc.adventure.save.SaveSlotInfo; diff --git a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/game/Game.java b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/game/Game.java index a56ee9a..0e4fd42 100644 --- a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/game/Game.java +++ b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/game/Game.java @@ -73,7 +73,7 @@ public class Game { if (ctx.getSession().getTurn() % 10 == 0) { ctx.save(); } - if (tutorialGuide != null) { + if (tutorialGuide != null && tutorialGuide.isActive()) { tutorialGuide.onCommand(ctx, parsed); } }