From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.Client/Common/Tutorial/TutorialTask.h | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Minecraft.Client/Common/Tutorial/TutorialTask.h (limited to 'Minecraft.Client/Common/Tutorial/TutorialTask.h') diff --git a/Minecraft.Client/Common/Tutorial/TutorialTask.h b/Minecraft.Client/Common/Tutorial/TutorialTask.h new file mode 100644 index 00000000..92cb5999 --- /dev/null +++ b/Minecraft.Client/Common/Tutorial/TutorialTask.h @@ -0,0 +1,63 @@ +#pragma once +using namespace std; +#include "TutorialEnum.h" + +class Level; +class Tutorial; +class TutorialConstraint; +class MobEffect; + +// A class that represents each individual task in the tutorial. +// +// Members: +// enablePreCompletion - If this is true, then the player can complete this task out of sequence. +// This stops us asking them to do things they have already done +// constraints - A list of constraints which can be activated (as a whole). +// If they are active, then the constraints are removed when the task is completed +// areConstraintsEnabled- A flag which records whether or not we have added the constraints to the tutorial +class TutorialTask +{ +protected: + int descriptionId; + int m_promptId; + Tutorial *tutorial; + bool enablePreCompletion; + bool bHasBeenActivated; + bool m_bAllowFade; + bool m_bTaskReminders; + bool m_bShowMinimumTime; + +protected: + bool bIsCompleted; + bool m_bShownForMinimumTime; + vector constraints; + bool areConstraintsEnabled; +public: + TutorialTask(Tutorial *tutorial, int descriptionId, bool enablePreCompletion, vector *inConstraints, bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true ); + virtual ~TutorialTask(); + + virtual int getDescriptionId() { return descriptionId; } + virtual int getPromptId() { return m_promptId; } + + virtual bool isCompleted() = 0; + virtual eTutorial_CompletionAction getCompletionAction() { return e_Tutorial_Completion_None; } + virtual bool isPreCompletionEnabled() { return enablePreCompletion; } + virtual void taskCompleted(); + virtual void enableConstraints(bool enable, bool delayRemove = false); + virtual void setAsCurrentTask(bool active = true); + + virtual void setShownForMinimumTime() { m_bShownForMinimumTime = true; } + virtual bool hasBeenActivated() { return bHasBeenActivated; } + virtual bool AllowFade() { return m_bAllowFade;} + bool TaskReminders() { return m_bTaskReminders;} + virtual bool ShowMinimumTime() { return m_bShowMinimumTime;} + + virtual void useItemOn(Level *level, shared_ptr item, int x, int y, int z, bool bTestUseOnly=false) { } + virtual void useItem(shared_ptr item,bool bTestUseOnly=false) { } + virtual void completeUsingItem(shared_ptr item) { } + virtual void handleUIInput(int iAction) { } + virtual void onCrafted(shared_ptr item) { } + virtual void onTake(shared_ptr item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { } + virtual void onStateChange(eTutorial_State newState) { } + virtual void onEffectChanged(MobEffect *effect, bool bRemoved=false) { } +}; \ No newline at end of file -- cgit v1.2.3