mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-12 04:03:53 +00:00
Initial commit
This commit is contained in:
parent
def8cb4153
commit
b691c43c44
19437 changed files with 4363922 additions and 0 deletions
37
Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp
Normal file
37
Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#include "stdafx.h"
|
||||
#include "..\..\..\Minecraft.World\ItemInstance.h"
|
||||
#include "CompleteUsingItemTask.h"
|
||||
|
||||
CompleteUsingItemTask::CompleteUsingItemTask(Tutorial *tutorial, int descriptionId, int itemIds[], unsigned int itemIdsLength, bool enablePreCompletion)
|
||||
: TutorialTask( tutorial, descriptionId, enablePreCompletion, NULL)
|
||||
{
|
||||
m_iValidItemsA= new int [itemIdsLength];
|
||||
for(int i=0;i<itemIdsLength;i++)
|
||||
{
|
||||
m_iValidItemsA[i]=itemIds[i];
|
||||
}
|
||||
m_iValidItemsCount = itemIdsLength;
|
||||
}
|
||||
|
||||
CompleteUsingItemTask::~CompleteUsingItemTask()
|
||||
{
|
||||
delete [] m_iValidItemsA;
|
||||
}
|
||||
|
||||
bool CompleteUsingItemTask::isCompleted()
|
||||
{
|
||||
return bIsCompleted;
|
||||
}
|
||||
|
||||
void CompleteUsingItemTask::completeUsingItem(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
if(!hasBeenActivated() && !isPreCompletionEnabled()) return;
|
||||
for(int i=0;i<m_iValidItemsCount;i++)
|
||||
{
|
||||
if( item->id == m_iValidItemsA[i] )
|
||||
{
|
||||
bIsCompleted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue