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:
@@ -43,7 +43,7 @@ SurvivalMode::SurvivalMode(SurvivalMode *copy) : GameMode( copy->minecraft )
|
||||
destroyDelay = copy->destroyDelay;
|
||||
}
|
||||
|
||||
void SurvivalMode::initPlayer(shared_ptr<Player> player)
|
||||
void SurvivalMode::initPlayer(std::shared_ptr<Player> player)
|
||||
{
|
||||
player->yRot = -180;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ bool SurvivalMode::destroyBlock(int x, int y, int z, int face)
|
||||
int data = minecraft->level->getData(x, y, z);
|
||||
bool changed = GameMode::destroyBlock(x, y, z, face);
|
||||
|
||||
shared_ptr<ItemInstance> item = minecraft->player->getSelectedItem();
|
||||
std::shared_ptr<ItemInstance> item = minecraft->player->getSelectedItem();
|
||||
bool couldDestroy = minecraft->player->canDestroy(Tile::tiles[t]);
|
||||
if (item != NULL)
|
||||
{
|
||||
@@ -73,7 +73,7 @@ bool SurvivalMode::destroyBlock(int x, int y, int z, int face)
|
||||
minecraft->player->removeSelectedItem();
|
||||
}
|
||||
}
|
||||
if (changed && couldDestroy)
|
||||
if (changed && couldDestroy)
|
||||
{
|
||||
Tile::tiles[t]->playerDestroy(minecraft->level, minecraft->player, x, y, z, data);
|
||||
}
|
||||
@@ -171,9 +171,9 @@ void SurvivalMode::initLevel(Level *level)
|
||||
GameMode::initLevel(level);
|
||||
}
|
||||
|
||||
shared_ptr<Player> SurvivalMode::createPlayer(Level *level)
|
||||
std::shared_ptr<Player> SurvivalMode::createPlayer(Level *level)
|
||||
{
|
||||
shared_ptr<Player> player = GameMode::createPlayer(level);
|
||||
std::shared_ptr<Player> player = GameMode::createPlayer(level);
|
||||
// player.inventory.add(new ItemInstance(Item.pickAxe_diamond));
|
||||
// player.inventory.add(new ItemInstance(Item.hatchet_diamond));
|
||||
// player.inventory.add(new ItemInstance(Tile.torch, 64));
|
||||
@@ -189,7 +189,7 @@ void SurvivalMode::tick()
|
||||
//minecraft->soundEngine->playMusicTick();
|
||||
}
|
||||
|
||||
bool SurvivalMode::useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, bool bTestUseOnOnly, bool *pbUsedItem)
|
||||
bool SurvivalMode::useItemOn(std::shared_ptr<Player> player, Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, int face, bool bTestUseOnOnly, bool *pbUsedItem)
|
||||
{
|
||||
int t = level->getTile(x, y, z);
|
||||
if (t > 0)
|
||||
|
||||
Reference in New Issue
Block a user