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:
void_17
2026-03-02 15:58:20 +07:00
parent d63f79325f
commit 7074f35e4b
1373 changed files with 12054 additions and 12054 deletions

View File

@@ -24,22 +24,22 @@ DamageSource *DamageSource::wither = (new DamageSource(ChatPacket::e_ChatDeathWi
DamageSource *DamageSource::anvil = (new DamageSource(ChatPacket::e_ChatDeathAnvil));
DamageSource *DamageSource::fallingBlock = (new DamageSource(ChatPacket::e_ChatDeathFallingBlock));
DamageSource *DamageSource::mobAttack(shared_ptr<Mob> mob)
DamageSource *DamageSource::mobAttack(std::shared_ptr<Mob> mob)
{
return new EntityDamageSource(ChatPacket::e_ChatDeathMob, mob);
}
DamageSource *DamageSource::playerAttack(shared_ptr<Player> player)
DamageSource *DamageSource::playerAttack(std::shared_ptr<Player> player)
{
return new EntityDamageSource(ChatPacket::e_ChatDeathPlayer, player);
}
DamageSource *DamageSource::arrow(shared_ptr<Arrow> arrow, shared_ptr<Entity> owner)
DamageSource *DamageSource::arrow(std::shared_ptr<Arrow> arrow, std::shared_ptr<Entity> owner)
{
return (new IndirectEntityDamageSource(ChatPacket::e_ChatDeathArrow, arrow, owner))->setProjectile();
}
DamageSource *DamageSource::fireball(shared_ptr<Fireball> fireball, shared_ptr<Entity> owner)
DamageSource *DamageSource::fireball(std::shared_ptr<Fireball> fireball, std::shared_ptr<Entity> owner)
{
if (owner == NULL)
{
@@ -48,17 +48,17 @@ DamageSource *DamageSource::fireball(shared_ptr<Fireball> fireball, shared_ptr<E
return (new IndirectEntityDamageSource(ChatPacket::e_ChatDeathFireball, fireball, owner))->setIsFire()->setProjectile();
}
DamageSource *DamageSource::thrown(shared_ptr<Entity> entity, shared_ptr<Entity> owner)
DamageSource *DamageSource::thrown(std::shared_ptr<Entity> entity, std::shared_ptr<Entity> owner)
{
return (new IndirectEntityDamageSource(ChatPacket::e_ChatDeathThrown, entity, owner))->setProjectile();
}
DamageSource *DamageSource::indirectMagic(shared_ptr<Entity> entity, shared_ptr<Entity> owner)
DamageSource *DamageSource::indirectMagic(std::shared_ptr<Entity> entity, std::shared_ptr<Entity> owner)
{
return (new IndirectEntityDamageSource(ChatPacket::e_ChatDeathIndirectMagic, entity, owner) )->bypassArmor()->setMagic();;
}
DamageSource *DamageSource::thorns(shared_ptr<Entity> source)
DamageSource *DamageSource::thorns(std::shared_ptr<Entity> source)
{
return (new EntityDamageSource(ChatPacket::e_ChatDeathThorns, source))->setMagic();
}
@@ -106,14 +106,14 @@ DamageSource::DamageSource(ChatPacket::EChatPacketMessage msgId)
m_msgId = msgId;
}
shared_ptr<Entity> DamageSource::getDirectEntity()
std::shared_ptr<Entity> DamageSource::getDirectEntity()
{
return getEntity();
}
shared_ptr<Entity> DamageSource::getEntity()
std::shared_ptr<Entity> DamageSource::getEntity()
{
return shared_ptr<Entity>();
return std::shared_ptr<Entity>();
}
DamageSource *DamageSource::bypassArmor()
@@ -158,15 +158,15 @@ DamageSource *DamageSource::setMagic()
return this;
}
//wstring DamageSource::getLocalizedDeathMessage(shared_ptr<Player> player)
//wstring DamageSource::getLocalizedDeathMessage(std::shared_ptr<Player> player)
//{
// return L"death." + msgId + player->name;
// //return I18n.get(L"death." + msgId, player.name);
//}
shared_ptr<ChatPacket> DamageSource::getDeathMessagePacket(shared_ptr<Player> player)
std::shared_ptr<ChatPacket> DamageSource::getDeathMessagePacket(std::shared_ptr<Player> player)
{
return shared_ptr<ChatPacket>( new ChatPacket(player->name, m_msgId ) );
return std::shared_ptr<ChatPacket>( new ChatPacket(player->name, m_msgId ) );
}
bool DamageSource::isFire()