shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
This commit is contained in:
@@ -24,7 +24,7 @@ ChangeStateConstraint::ChangeStateConstraint( Tutorial *tutorial, eTutorial_Stat
|
||||
m_tutorial = tutorial;
|
||||
m_targetState = targetState;
|
||||
m_sourceStatesCount = sourceStatesCount;
|
||||
|
||||
|
||||
m_bHasChanged = false;
|
||||
m_changedFromState = e_Tutorial_State_None;
|
||||
|
||||
@@ -59,11 +59,11 @@ void ChangeStateConstraint::tick(int iPad)
|
||||
if(originalPrivileges != playerPrivs)
|
||||
{
|
||||
// Send update settings packet to server
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL)
|
||||
{
|
||||
player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,11 +100,11 @@ void ChangeStateConstraint::tick(int iPad)
|
||||
if(originalPrivileges != playerPrivs)
|
||||
{
|
||||
// Send update settings packet to server
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL)
|
||||
{
|
||||
player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,11 +124,11 @@ void ChangeStateConstraint::tick(int iPad)
|
||||
if(originalPrivileges != playerPrivs)
|
||||
{
|
||||
// Send update settings packet to server
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL)
|
||||
{
|
||||
player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
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++)
|
||||
{
|
||||
@@ -23,7 +23,7 @@ bool CompleteUsingItemTask::isCompleted()
|
||||
return bIsCompleted;
|
||||
}
|
||||
|
||||
void CompleteUsingItemTask::completeUsingItem(shared_ptr<ItemInstance> item)
|
||||
void CompleteUsingItemTask::completeUsingItem(std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
if(!hasBeenActivated() && !isPreCompletionEnabled()) return;
|
||||
for(int i=0;i<m_iValidItemsCount;i++)
|
||||
|
||||
@@ -16,5 +16,5 @@ public:
|
||||
CompleteUsingItemTask(Tutorial *tutorial, int descriptionId, int itemIds[], unsigned int itemIdsLength, bool enablePreCompletion = false);
|
||||
virtual ~CompleteUsingItemTask();
|
||||
virtual bool isCompleted();
|
||||
virtual void completeUsingItem(shared_ptr<ItemInstance> item);
|
||||
virtual void completeUsingItem(std::shared_ptr<ItemInstance> item);
|
||||
};
|
||||
@@ -40,7 +40,7 @@ CraftTask::~CraftTask()
|
||||
delete[] m_auxValues;
|
||||
}
|
||||
|
||||
void CraftTask::onCrafted(shared_ptr<ItemInstance> item)
|
||||
void CraftTask::onCrafted(std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
wprintf(L"CraftTask::onCrafted - %ls\n", item->toString().c_str() );
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
~CraftTask();
|
||||
|
||||
virtual bool isCompleted() { return bIsCompleted; }
|
||||
virtual void onCrafted(shared_ptr<ItemInstance> item);
|
||||
virtual void onCrafted(std::shared_ptr<ItemInstance> item);
|
||||
|
||||
private:
|
||||
int *m_items;
|
||||
|
||||
@@ -20,7 +20,7 @@ DiggerItemHint::DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descri
|
||||
tutorial->addMessage(IDS_TUTORIAL_HINT_ATTACK_WITH_TOOL, true);
|
||||
}
|
||||
|
||||
int DiggerItemHint::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
|
||||
int DiggerItemHint::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile)
|
||||
{
|
||||
if(item != NULL)
|
||||
{
|
||||
@@ -46,7 +46,7 @@ int DiggerItemHint::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int DiggerItemHint::attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity)
|
||||
int DiggerItemHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity)
|
||||
{
|
||||
if(item != NULL)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,6 @@ private:
|
||||
|
||||
public:
|
||||
DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, int items[], unsigned int itemsLength);
|
||||
virtual int startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile);
|
||||
virtual int attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity);
|
||||
virtual int startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile);
|
||||
virtual int attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity);
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "PickupTask.h"
|
||||
|
||||
void PickupTask::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
void PickupTask::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
{
|
||||
if(item->id == m_itemId)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
{}
|
||||
|
||||
virtual bool isCompleted() { return bIsCompleted; }
|
||||
virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
virtual void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
|
||||
private:
|
||||
int m_itemId;
|
||||
|
||||
@@ -111,7 +111,7 @@ bool ProcedureCompoundTask::isCompleted()
|
||||
return allCompleted;
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::onCrafted(shared_ptr<ItemInstance> item)
|
||||
void ProcedureCompoundTask::onCrafted(std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
|
||||
@@ -222,7 +222,7 @@ bool ProcedureCompoundTask::AllowFade()
|
||||
return allowFade;
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
|
||||
void ProcedureCompoundTask::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
|
||||
{
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
|
||||
@@ -232,7 +232,7 @@ void ProcedureCompoundTask::useItemOn(Level *level, shared_ptr<ItemInstance> ite
|
||||
}
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
{
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
|
||||
@@ -242,7 +242,7 @@ void ProcedureCompoundTask::useItem(shared_ptr<ItemInstance> item, bool bTestUse
|
||||
}
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
void ProcedureCompoundTask::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
{
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
virtual int getDescriptionId();
|
||||
virtual int getPromptId();
|
||||
virtual bool isCompleted();
|
||||
virtual void onCrafted(shared_ptr<ItemInstance> item);
|
||||
virtual void onCrafted(std::shared_ptr<ItemInstance> item);
|
||||
virtual void handleUIInput(int iAction);
|
||||
virtual void setAsCurrentTask(bool active = true);
|
||||
virtual bool ShowMinimumTime();
|
||||
@@ -26,9 +26,9 @@ public:
|
||||
virtual void setShownForMinimumTime();
|
||||
virtual bool AllowFade();
|
||||
|
||||
virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
|
||||
virtual void useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
virtual void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
|
||||
virtual void useItem(std::shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
virtual void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
virtual void onStateChange(eTutorial_State newState);
|
||||
|
||||
private:
|
||||
|
||||
@@ -17,7 +17,7 @@ TakeItemHint::TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], u
|
||||
}
|
||||
}
|
||||
|
||||
bool TakeItemHint::onTake(shared_ptr<ItemInstance> item)
|
||||
bool TakeItemHint::onTake(std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
if(item != NULL)
|
||||
{
|
||||
|
||||
@@ -15,5 +15,5 @@ public:
|
||||
TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], unsigned int itemsLength);
|
||||
~TakeItemHint();
|
||||
|
||||
virtual bool onTake( shared_ptr<ItemInstance> item );
|
||||
virtual bool onTake( std::shared_ptr<ItemInstance> item );
|
||||
};
|
||||
@@ -1681,7 +1681,7 @@ void Tutorial::showTutorialPopup(bool show)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly)
|
||||
void Tutorial::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly)
|
||||
{
|
||||
for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it)
|
||||
{
|
||||
@@ -1690,7 +1690,7 @@ void Tutorial::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::useItemOn(shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
{
|
||||
for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it)
|
||||
{
|
||||
@@ -1699,7 +1699,7 @@ void Tutorial::useItemOn(shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::completeUsingItem(shared_ptr<ItemInstance> item)
|
||||
void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it)
|
||||
{
|
||||
@@ -1718,7 +1718,7 @@ void Tutorial::completeUsingItem(shared_ptr<ItemInstance> item)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
|
||||
void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile)
|
||||
{
|
||||
int hintNeeded = -1;
|
||||
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
|
||||
@@ -1754,7 +1754,7 @@ void Tutorial::destroyBlock(Tile *tile)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::attack(shared_ptr<Player> player, shared_ptr<Entity> entity)
|
||||
void Tutorial::attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity)
|
||||
{
|
||||
int hintNeeded = -1;
|
||||
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
|
||||
@@ -1772,7 +1772,7 @@ void Tutorial::attack(shared_ptr<Player> player, shared_ptr<Entity> entity)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::itemDamaged(shared_ptr<ItemInstance> item)
|
||||
void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
int hintNeeded = -1;
|
||||
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
|
||||
@@ -1803,7 +1803,7 @@ void Tutorial::handleUIInput(int iAction)
|
||||
currentTask[m_CurrentState]->handleUIInput(iAction);
|
||||
}
|
||||
|
||||
void Tutorial::createItemSelected(shared_ptr<ItemInstance> item, bool canMake)
|
||||
void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake)
|
||||
{
|
||||
int hintNeeded = -1;
|
||||
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
|
||||
@@ -1821,7 +1821,7 @@ void Tutorial::createItemSelected(shared_ptr<ItemInstance> item, bool canMake)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::onCrafted(shared_ptr<ItemInstance> item)
|
||||
void Tutorial::onCrafted(std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
for(unsigned int state = 0; state < e_Tutorial_State_Max; ++state)
|
||||
{
|
||||
@@ -1833,7 +1833,7 @@ void Tutorial::onCrafted(shared_ptr<ItemInstance> item)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
void Tutorial::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
{
|
||||
if( !m_hintDisplayed )
|
||||
{
|
||||
@@ -1860,7 +1860,7 @@ void Tutorial::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAn
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::onSelectedItemChanged(shared_ptr<ItemInstance> item)
|
||||
void Tutorial::onSelectedItemChanged(std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
// We only handle this if we are in a state that allows changing based on the selected item
|
||||
// Menus and states like riding in a minecart will NOT allow this
|
||||
|
||||
@@ -11,7 +11,7 @@ using namespace std;
|
||||
// #define TUTORIAL_MINIMUM_DISPLAY_MESSAGE_TIME 2000
|
||||
// #define TUTORIAL_REMINDER_TIME (TUTORIAL_DISPLAY_MESSAGE_TIME + 20000)
|
||||
// #define TUTORIAL_CONSTRAINT_DELAY_REMOVE_TICKS 15
|
||||
//
|
||||
//
|
||||
// // 0-24000
|
||||
// #define TUTORIAL_FREEZE_TIME_VALUE 8000
|
||||
|
||||
@@ -151,19 +151,19 @@ public:
|
||||
|
||||
void showTutorialPopup(bool show);
|
||||
|
||||
void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly=false);
|
||||
void useItemOn(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
void completeUsingItem(shared_ptr<ItemInstance> item);
|
||||
void startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile);
|
||||
void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly=false);
|
||||
void useItemOn(std::shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
void completeUsingItem(std::shared_ptr<ItemInstance> item);
|
||||
void startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile);
|
||||
void destroyBlock(Tile *tile);
|
||||
void attack(shared_ptr<Player> player, shared_ptr<Entity> entity);
|
||||
void itemDamaged(shared_ptr<ItemInstance> item);
|
||||
void attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity);
|
||||
void itemDamaged(std::shared_ptr<ItemInstance> item);
|
||||
|
||||
void handleUIInput(int iAction);
|
||||
void createItemSelected(shared_ptr<ItemInstance> item, bool canMake);
|
||||
void onCrafted(shared_ptr<ItemInstance> item);
|
||||
void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
void onSelectedItemChanged(shared_ptr<ItemInstance> item);
|
||||
void createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake);
|
||||
void onCrafted(std::shared_ptr<ItemInstance> item);
|
||||
void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
void onSelectedItemChanged(std::shared_ptr<ItemInstance> item);
|
||||
void onLookAt(int id, int iData=0);
|
||||
void onLookAtEntity(eINSTANCEOF type);
|
||||
void onEffectChanged(MobEffect *effect, bool bRemoved=false);
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "..\..\MultiplayerLocalPlayer.h"
|
||||
|
||||
TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, eHintType type, bool allowFade /*= true*/)
|
||||
TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, eHintType type, bool allowFade /*= true*/)
|
||||
: m_id( id ), m_tutorial(tutorial), m_descriptionId( descriptionId ), m_type( type ), m_counter( 0 ),
|
||||
m_lastTile( NULL ), m_hintNeeded( true ), m_allowFade(allowFade)
|
||||
{
|
||||
tutorial->addMessage(descriptionId, type != e_Hint_NoIngredients);
|
||||
}
|
||||
|
||||
int TutorialHint::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
|
||||
int TutorialHint::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile)
|
||||
{
|
||||
int returnVal = -1;
|
||||
switch(m_type)
|
||||
@@ -59,7 +59,7 @@ int TutorialHint::destroyBlock(Tile *tile)
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
int TutorialHint::attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity)
|
||||
int TutorialHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity)
|
||||
{
|
||||
/*
|
||||
switch(m_type)
|
||||
@@ -71,7 +71,7 @@ int TutorialHint::attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entit
|
||||
return -1;
|
||||
}
|
||||
|
||||
int TutorialHint::createItemSelected(shared_ptr<ItemInstance> item, bool canMake)
|
||||
int TutorialHint::createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake)
|
||||
{
|
||||
int returnVal = -1;
|
||||
switch(m_type)
|
||||
@@ -86,7 +86,7 @@ int TutorialHint::createItemSelected(shared_ptr<ItemInstance> item, bool canMake
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
int TutorialHint::itemDamaged(shared_ptr<ItemInstance> item)
|
||||
int TutorialHint::itemDamaged(std::shared_ptr<ItemInstance> item)
|
||||
{
|
||||
int returnVal = -1;
|
||||
switch(m_type)
|
||||
@@ -100,7 +100,7 @@ int TutorialHint::itemDamaged(shared_ptr<ItemInstance> item)
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
bool TutorialHint::onTake( shared_ptr<ItemInstance> item )
|
||||
bool TutorialHint::onTake( std::shared_ptr<ItemInstance> item )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ int TutorialHint::tick()
|
||||
switch(m_type)
|
||||
{
|
||||
case e_Hint_SwimUp:
|
||||
if( Minecraft::GetInstance()->localplayers[m_tutorial->getPad()]->isUnderLiquid(Material::water) ) returnVal = m_descriptionId;
|
||||
if( Minecraft::GetInstance()->localplayers[m_tutorial->getPad()]->isUnderLiquid(Material::water) ) returnVal = m_descriptionId;
|
||||
break;
|
||||
}
|
||||
return returnVal;
|
||||
|
||||
@@ -10,7 +10,7 @@ class Tutorial;
|
||||
|
||||
class TutorialHint
|
||||
{
|
||||
public:
|
||||
public:
|
||||
enum eHintType
|
||||
{
|
||||
e_Hint_DiggerItem,
|
||||
@@ -40,12 +40,12 @@ public:
|
||||
|
||||
eTutorial_Hint getId() { return m_id; }
|
||||
|
||||
virtual int startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile);
|
||||
virtual int startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile);
|
||||
virtual int destroyBlock(Tile *tile);
|
||||
virtual int attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity);
|
||||
virtual int createItemSelected(shared_ptr<ItemInstance> item, bool canMake);
|
||||
virtual int itemDamaged(shared_ptr<ItemInstance> item);
|
||||
virtual bool onTake( shared_ptr<ItemInstance> item );
|
||||
virtual int attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity);
|
||||
virtual int createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake);
|
||||
virtual int itemDamaged(std::shared_ptr<ItemInstance> item);
|
||||
virtual bool onTake( std::shared_ptr<ItemInstance> item );
|
||||
virtual bool onLookAt(int id, int iData=0);
|
||||
virtual bool onLookAtEntity(eINSTANCEOF type);
|
||||
virtual int tick();
|
||||
|
||||
@@ -36,7 +36,7 @@ bool TutorialMode::destroyBlock(int x, int y, int z, int face)
|
||||
int t = minecraft->level->getTile(x, y, z);
|
||||
tutorial->destroyBlock(Tile::tiles[t]);
|
||||
}
|
||||
shared_ptr<ItemInstance> item = minecraft->player->getSelectedItem();
|
||||
std::shared_ptr<ItemInstance> item = minecraft->player->getSelectedItem();
|
||||
int damageBefore;
|
||||
if(item != NULL)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ bool TutorialMode::destroyBlock(int x, int y, int z, int face)
|
||||
if(!tutorial->m_allTutorialsComplete)
|
||||
{
|
||||
if ( item != NULL && item->isDamageableItem() )
|
||||
{
|
||||
{
|
||||
int max = item->getMaxDamage();
|
||||
int damageNow = item->getDamageValue();
|
||||
|
||||
@@ -78,7 +78,7 @@ void TutorialMode::tick()
|
||||
*/
|
||||
}
|
||||
|
||||
bool TutorialMode::useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem)
|
||||
bool TutorialMode::useItemOn(std::shared_ptr<Player> player, Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem)
|
||||
{
|
||||
bool haveItem = false;
|
||||
int itemCount = 0;
|
||||
@@ -87,7 +87,7 @@ bool TutorialMode::useItemOn(shared_ptr<Player> player, Level *level, shared_ptr
|
||||
tutorial->useItemOn(level, item, x, y, z, bTestUseOnly);
|
||||
|
||||
if(!bTestUseOnly)
|
||||
{
|
||||
{
|
||||
if(item != NULL)
|
||||
{
|
||||
haveItem = true;
|
||||
@@ -110,7 +110,7 @@ bool TutorialMode::useItemOn(shared_ptr<Player> player, Level *level, shared_ptr
|
||||
return result;
|
||||
}
|
||||
|
||||
void TutorialMode::attack(shared_ptr<Player> player, shared_ptr<Entity> entity)
|
||||
void TutorialMode::attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity)
|
||||
{
|
||||
if(!tutorial->m_allTutorialsComplete)
|
||||
tutorial->attack(player, entity);
|
||||
|
||||
@@ -19,8 +19,8 @@ public:
|
||||
virtual void startDestroyBlock(int x, int y, int z, int face);
|
||||
virtual bool destroyBlock(int x, int y, int z, int face);
|
||||
virtual void tick();
|
||||
virtual bool useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL);
|
||||
virtual void attack(shared_ptr<Player> player, shared_ptr<Entity> entity);
|
||||
virtual bool useItemOn(std::shared_ptr<Player> player, Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL);
|
||||
virtual void attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity);
|
||||
|
||||
virtual bool isInputAllowed(int mapping);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ protected:
|
||||
bool m_bAllowFade;
|
||||
bool m_bTaskReminders;
|
||||
bool m_bShowMinimumTime;
|
||||
|
||||
|
||||
protected:
|
||||
bool bIsCompleted;
|
||||
bool m_bShownForMinimumTime;
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
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 enableConstraints(bool enable, bool delayRemove = false);
|
||||
virtual void setAsCurrentTask(bool active = true);
|
||||
|
||||
virtual void setShownForMinimumTime() { m_bShownForMinimumTime = true; }
|
||||
@@ -52,12 +52,12 @@ public:
|
||||
bool TaskReminders() { return m_bTaskReminders;}
|
||||
virtual bool ShowMinimumTime() { return m_bShowMinimumTime;}
|
||||
|
||||
virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false) { }
|
||||
virtual void useItem(shared_ptr<ItemInstance> item,bool bTestUseOnly=false) { }
|
||||
virtual void completeUsingItem(shared_ptr<ItemInstance> item) { }
|
||||
virtual void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false) { }
|
||||
virtual void useItem(std::shared_ptr<ItemInstance> item,bool bTestUseOnly=false) { }
|
||||
virtual void completeUsingItem(std::shared_ptr<ItemInstance> item) { }
|
||||
virtual void handleUIInput(int iAction) { }
|
||||
virtual void onCrafted(shared_ptr<ItemInstance> item) { }
|
||||
virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { }
|
||||
virtual void onCrafted(std::shared_ptr<ItemInstance> item) { }
|
||||
virtual void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { }
|
||||
virtual void onStateChange(eTutorial_State newState) { }
|
||||
virtual void onEffectChanged(MobEffect *effect, bool bRemoved=false) { }
|
||||
};
|
||||
@@ -16,7 +16,7 @@ bool UseItemTask::isCompleted()
|
||||
return bIsCompleted;
|
||||
}
|
||||
|
||||
void UseItemTask::useItem(shared_ptr<ItemInstance> item,bool bTestUseOnly)
|
||||
void UseItemTask::useItem(std::shared_ptr<ItemInstance> item,bool bTestUseOnly)
|
||||
{
|
||||
if(bTestUseOnly) return;
|
||||
|
||||
|
||||
@@ -16,5 +16,5 @@ public:
|
||||
UseItemTask(const int itemId, Tutorial *tutorial, int descriptionId,
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true );
|
||||
virtual bool isCompleted();
|
||||
virtual void useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
virtual void useItem(std::shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
};
|
||||
@@ -25,7 +25,7 @@ bool UseTileTask::isCompleted()
|
||||
return bIsCompleted;
|
||||
}
|
||||
|
||||
void UseTileTask::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
|
||||
void UseTileTask::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
|
||||
{
|
||||
if(bTestUseOnly) return;
|
||||
|
||||
|
||||
@@ -20,5 +20,5 @@ public:
|
||||
UseTileTask(const int tileId, Tutorial *tutorial, int descriptionId,
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true);
|
||||
virtual bool isCompleted();
|
||||
virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
|
||||
virtual void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
|
||||
};
|
||||
Reference in New Issue
Block a user