diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
| commit | 7074f35e4ba831e358117842b99ee35b87f85ae5 (patch) | |
| tree | 7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/EntityDamageSource.cpp | |
| parent | d63f79325f85e014361eb8cf1e41eaebedb1ae71 (diff) | |
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.
Diffstat (limited to 'Minecraft.World/EntityDamageSource.cpp')
| -rw-r--r-- | Minecraft.World/EntityDamageSource.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Minecraft.World/EntityDamageSource.cpp b/Minecraft.World/EntityDamageSource.cpp index 8c7a5ee1..266c867f 100644 --- a/Minecraft.World/EntityDamageSource.cpp +++ b/Minecraft.World/EntityDamageSource.cpp @@ -4,32 +4,32 @@ #include "net.minecraft.world.damagesource.h" #include "net.minecraft.network.packet.h" -//EntityDamageSource::EntityDamageSource(const wstring &msgId, shared_ptr<Entity> entity) : DamageSource(msgId) -EntityDamageSource::EntityDamageSource(ChatPacket::EChatPacketMessage msgId, shared_ptr<Entity> entity) : DamageSource(msgId) +//EntityDamageSource::EntityDamageSource(const wstring &msgId, std::shared_ptr<Entity> entity) : DamageSource(msgId) +EntityDamageSource::EntityDamageSource(ChatPacket::EChatPacketMessage msgId, std::shared_ptr<Entity> entity) : DamageSource(msgId) { this->entity = entity; } -shared_ptr<Entity> EntityDamageSource::getEntity() +std::shared_ptr<Entity> EntityDamageSource::getEntity() { return entity; } -//wstring EntityDamageSource::getLocalizedDeathMessage(shared_ptr<Player> player) +//wstring EntityDamageSource::getLocalizedDeathMessage(std::shared_ptr<Player> player) //{ // return L"death." + msgId + player->name + entity->getAName(); // //return I18n.get("death." + msgId, player.name, entity.getAName()); //} -shared_ptr<ChatPacket> EntityDamageSource::getDeathMessagePacket(shared_ptr<Player> player) +std::shared_ptr<ChatPacket> EntityDamageSource::getDeathMessagePacket(std::shared_ptr<Player> player) { wstring additional = L""; if(entity->GetType() == eTYPE_SERVERPLAYER) { - shared_ptr<Player> sourcePlayer = dynamic_pointer_cast<Player>(entity); + std::shared_ptr<Player> sourcePlayer = dynamic_pointer_cast<Player>(entity); if(sourcePlayer != NULL) additional = sourcePlayer->name; } - return shared_ptr<ChatPacket>( new ChatPacket(player->name, m_msgId, entity->GetType(), additional ) ); + return std::shared_ptr<ChatPacket>( new ChatPacket(player->name, m_msgId, entity->GetType(), additional ) ); } bool EntityDamageSource::scalesWithDifficulty() |
