From 46398f4671012a0d913bd7bc0c70ffdc2645f2ac Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sat, 1 Aug 2020 20:18:03 +0200 Subject: Replaced cpp14::make_unique<> with std::make_unique<>. --- src/Mobs/Blaze.cpp | 2 +- src/Mobs/Ghast.cpp | 2 +- src/Mobs/Monster.cpp | 66 +++++++++++++++++++++++++-------------------------- src/Mobs/Skeleton.cpp | 2 +- src/Mobs/Slime.cpp | 2 +- 5 files changed, 37 insertions(+), 37 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Blaze.cpp b/src/Mobs/Blaze.cpp index a87cc02fb..a1c41d392 100644 --- a/src/Mobs/Blaze.cpp +++ b/src/Mobs/Blaze.cpp @@ -69,7 +69,7 @@ void cBlaze::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) Vector3d Speed = GetLookVector() * 20; Speed.y = Speed.y + 1; - auto FireCharge = cpp14::make_unique(this, GetPosition().addedY(1), Speed); + auto FireCharge = std::make_unique(this, GetPosition().addedY(1), Speed); auto FireChargePtr = FireCharge.get(); FireChargePtr->Initialize(std::move(FireCharge), *m_World); diff --git a/src/Mobs/Ghast.cpp b/src/Mobs/Ghast.cpp index 88b10294a..3b20bea28 100644 --- a/src/Mobs/Ghast.cpp +++ b/src/Mobs/Ghast.cpp @@ -89,7 +89,7 @@ void cGhast::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) Vector3d Speed = GetLookVector() * 20; Speed.y = Speed.y + 1; - auto GhastBall = cpp14::make_unique(this, GetPosition(), Speed); + auto GhastBall = std::make_unique(this, GetPosition(), Speed); auto GhastBallPtr = GhastBall.get(); GhastBallPtr->Initialize(std::move(GhastBall), *m_World); diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 1c3b3a45e..ec240b61c 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -1181,13 +1181,13 @@ std::unique_ptr cMonster::NewMonsterFromType(eMonsterType a_MobType) { case mtMagmaCube: { - return cpp14::make_unique(1 << Random.RandInt(2)); // Size 1, 2 or 4 + return std::make_unique(1 << Random.RandInt(2)); // Size 1, 2 or 4 } case mtSlime: { - return cpp14::make_unique(1 << Random.RandInt(2)); // Size 1, 2 or 4 + return std::make_unique(1 << Random.RandInt(2)); // Size 1, 2 or 4 } - case mtVillager: return cpp14::make_unique(cVillager::GetRandomProfession()); + case mtVillager: return std::make_unique(cVillager::GetRandomProfession()); case mtHorse: { // Horses take a type (species), a colour, and a style (dots, stripes, etc.) @@ -1202,40 +1202,40 @@ std::unique_ptr cMonster::NewMonsterFromType(eMonsterType a_MobType) HorseType = 0; } - return cpp14::make_unique(HorseType, HorseColor, HorseStyle, HorseTameTimes); + return std::make_unique(HorseType, HorseColor, HorseStyle, HorseTameTimes); } case mtZombieVillager: { - return cpp14::make_unique(cVillager::GetRandomProfession()); + return std::make_unique(cVillager::GetRandomProfession()); } - case mtBat: return cpp14::make_unique(); - case mtBlaze: return cpp14::make_unique(); - case mtCaveSpider: return cpp14::make_unique(); - case mtChicken: return cpp14::make_unique(); - case mtCow: return cpp14::make_unique(); - case mtCreeper: return cpp14::make_unique(); - case mtEnderDragon: return cpp14::make_unique(); - case mtEnderman: return cpp14::make_unique(); - case mtGhast: return cpp14::make_unique(); - case mtGiant: return cpp14::make_unique(); - case mtGuardian: return cpp14::make_unique(); - case mtIronGolem: return cpp14::make_unique(); - case mtMooshroom: return cpp14::make_unique(); - case mtOcelot: return cpp14::make_unique(); - case mtPig: return cpp14::make_unique(); - case mtRabbit: return cpp14::make_unique(); - case mtSheep: return cpp14::make_unique(); - case mtSilverfish: return cpp14::make_unique(); - case mtSkeleton: return cpp14::make_unique(); - case mtSnowGolem: return cpp14::make_unique(); - case mtSpider: return cpp14::make_unique(); - case mtSquid: return cpp14::make_unique(); - case mtWitch: return cpp14::make_unique(); - case mtWither: return cpp14::make_unique(); - case mtWitherSkeleton: return cpp14::make_unique(); - case mtWolf: return cpp14::make_unique(); - case mtZombie: return cpp14::make_unique(); - case mtZombiePigman: return cpp14::make_unique(); + case mtBat: return std::make_unique(); + case mtBlaze: return std::make_unique(); + case mtCaveSpider: return std::make_unique(); + case mtChicken: return std::make_unique(); + case mtCow: return std::make_unique(); + case mtCreeper: return std::make_unique(); + case mtEnderDragon: return std::make_unique(); + case mtEnderman: return std::make_unique(); + case mtGhast: return std::make_unique(); + case mtGiant: return std::make_unique(); + case mtGuardian: return std::make_unique(); + case mtIronGolem: return std::make_unique(); + case mtMooshroom: return std::make_unique(); + case mtOcelot: return std::make_unique(); + case mtPig: return std::make_unique(); + case mtRabbit: return std::make_unique(); + case mtSheep: return std::make_unique(); + case mtSilverfish: return std::make_unique(); + case mtSkeleton: return std::make_unique(); + case mtSnowGolem: return std::make_unique(); + case mtSpider: return std::make_unique(); + case mtSquid: return std::make_unique(); + case mtWitch: return std::make_unique(); + case mtWither: return std::make_unique(); + case mtWitherSkeleton: return std::make_unique(); + case mtWolf: return std::make_unique(); + case mtZombie: return std::make_unique(); + case mtZombiePigman: return std::make_unique(); default: { ASSERT(!"Unhandled mob type whilst trying to spawn mob!"); diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp index 44700e9d3..3af4cad6e 100644 --- a/src/Mobs/Skeleton.cpp +++ b/src/Mobs/Skeleton.cpp @@ -46,7 +46,7 @@ bool cSkeleton::Attack(std::chrono::milliseconds a_Dt) Vector3d Speed = (GetTarget()->GetPosition() + Inaccuracy - GetPosition()) * 5; Speed.y += Random.RandInt(-1, 1); - auto Arrow = cpp14::make_unique(this, GetPosition().addedY(1), Speed); + auto Arrow = std::make_unique(this, GetPosition().addedY(1), Speed); auto ArrowPtr = Arrow.get(); if (!ArrowPtr->Initialize(std::move(Arrow), *m_World)) { diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp index 00cf30d13..601d9b747 100644 --- a/src/Mobs/Slime.cpp +++ b/src/Mobs/Slime.cpp @@ -79,7 +79,7 @@ void cSlime::KilledBy(TakeDamageInfo & a_TDI) double AddX = (i % 2 - 0.5) * m_Size / 4.0; double AddZ = (i / 2 - 0.5) * m_Size / 4.0; - auto NewSlime = cpp14::make_unique(m_Size / 2); + auto NewSlime = std::make_unique(m_Size / 2); NewSlime->SetPosition(GetPosX() + AddX, GetPosY() + 0.5, GetPosZ() + AddZ); NewSlime->SetYaw(Random.RandReal(360.0f)); m_World->SpawnMobFinalize(std::move(NewSlime)); -- cgit v1.2.3