mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-23 10:56:14 +00:00
exclude unused GameMode implementations, format Platform/Common/Tutorial
This commit is contained in:
@@ -2,36 +2,29 @@
|
||||
#include "../../Minecraft.World/Items/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(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;
|
||||
}
|
||||
CompleteUsingItemTask::~CompleteUsingItemTask() { delete[] m_iValidItemsA; }
|
||||
|
||||
bool CompleteUsingItemTask::isCompleted()
|
||||
{
|
||||
return bIsCompleted;
|
||||
}
|
||||
bool CompleteUsingItemTask::isCompleted() { return bIsCompleted; }
|
||||
|
||||
void CompleteUsingItemTask::completeUsingItem(std::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;
|
||||
}
|
||||
}
|
||||
void CompleteUsingItemTask::completeUsingItem(
|
||||
std::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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user