the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 67 lines 2.8 kB view raw
1#pragma once 2using namespace std; 3#include "TutorialEnum.h" 4 5class Level; 6class Tutorial; 7class TutorialConstraint; 8class MobEffect; 9class Entity; 10 11// A class that represents each individual task in the tutorial. 12// 13// Members: 14// enablePreCompletion - If this is true, then the player can complete this task out of sequence. 15// This stops us asking them to do things they have already done 16// constraints - A list of constraints which can be activated (as a whole). 17// If they are active, then the constraints are removed when the task is completed 18// areConstraintsEnabled- A flag which records whether or not we have added the constraints to the tutorial 19class TutorialTask 20{ 21protected: 22 int descriptionId; 23 int m_promptId; 24 Tutorial *tutorial; 25 bool enablePreCompletion; 26 bool bHasBeenActivated; 27 bool m_bAllowFade; 28 bool m_bTaskReminders; 29 bool m_bShowMinimumTime; 30 31protected: 32 bool bIsCompleted; 33 bool m_bShownForMinimumTime; 34 vector<TutorialConstraint *> constraints; 35 bool areConstraintsEnabled; 36public: 37 TutorialTask(Tutorial *tutorial, int descriptionId, bool enablePreCompletion, vector<TutorialConstraint *> *inConstraints, bool bShowMinimumTime=false, bool bAllowFade=true, bool bTaskReminders=true ); 38 virtual ~TutorialTask(); 39 40 virtual int getDescriptionId() { return descriptionId; } 41 virtual int getPromptId() { return m_promptId; } 42 43 virtual bool isCompleted() = 0; 44 virtual eTutorial_CompletionAction getCompletionAction() { return e_Tutorial_Completion_None; } 45 virtual bool isPreCompletionEnabled() { return enablePreCompletion; } 46 virtual void taskCompleted(); 47 virtual void enableConstraints(bool enable, bool delayRemove = false); 48 virtual void setAsCurrentTask(bool active = true); 49 50 virtual void setShownForMinimumTime() { m_bShownForMinimumTime = true; } 51 virtual bool hasBeenActivated() { return bHasBeenActivated; } 52 virtual bool AllowFade() { return m_bAllowFade;} 53 bool TaskReminders() { return m_bTaskReminders;} 54 virtual bool ShowMinimumTime() { return m_bShowMinimumTime;} 55 56 virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false) { } 57 virtual void useItem(shared_ptr<ItemInstance> item,bool bTestUseOnly=false) { } 58 virtual void completeUsingItem(shared_ptr<ItemInstance> item) { } 59 virtual void handleUIInput(int iAction) { } 60 virtual void onCrafted(shared_ptr<ItemInstance> item) { } 61 virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { } 62 virtual void onStateChange(eTutorial_State newState) { } 63 virtual void onEffectChanged(MobEffect *effect, bool bRemoved=false) { } 64 65 virtual void onLookAtEntity(shared_ptr<Entity> entity) { } 66 virtual void onRideEntity(shared_ptr<Entity> entity) { } 67};