mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-25 10:53:36 +00:00
23 lines
966 B
C++
23 lines
966 B
C++
#include "../../Minecraft.World/Platform/stdafx.h"
|
|
#include "../../Minecraft.World/Entities/Entity.h"
|
|
#include "../../Minecraft.World/Level/Level.h"
|
|
#include "../../Minecraft.World/Items/ItemInstance.h"
|
|
#include "UseItemTask.h"
|
|
|
|
UseItemTask::UseItemTask(const int itemId, Tutorial* tutorial,
|
|
int descriptionId, bool enablePreCompletion,
|
|
std::vector<TutorialConstraint*>* inConstraints,
|
|
bool bShowMinimumTime, bool bAllowFade,
|
|
bool bTaskReminders)
|
|
: TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints,
|
|
bShowMinimumTime, bAllowFade, bTaskReminders),
|
|
itemId(itemId) {}
|
|
|
|
bool UseItemTask::isCompleted() { return bIsCompleted; }
|
|
|
|
void UseItemTask::useItem(std::shared_ptr<ItemInstance> item,
|
|
bool bTestUseOnly) {
|
|
if (bTestUseOnly) return;
|
|
|
|
if (item->id == itemId) bIsCompleted = true;
|
|
} |