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/Bindings/LuaState.cpp | 10 +- src/Bindings/ManualBindings_Network.cpp | 4 +- src/Bindings/ManualBindings_World.cpp | 4 +- src/BlockEntities/BlockEntity.cpp | 38 +++--- src/Blocks/BlockFence.h | 2 +- src/BrewingRecipes.cpp | 6 +- src/ChunkDataCallback.h | 2 +- src/ChunkMap.cpp | 6 +- src/ChunkSender.cpp | 2 +- src/ClientHandle.cpp | 2 +- src/CraftingRecipes.cpp | 4 +- src/Entities/EntityEffect.cpp | 50 ++++---- src/Entities/ProjectileEntity.cpp | 20 +-- src/FurnaceRecipe.cpp | 6 +- src/Generating/PieceGeneratorBFSTree.cpp | 2 +- src/Generating/PrefabPiecePool.cpp | 4 +- src/Globals.h | 5 - src/Items/ItemBow.h | 2 +- src/Items/ItemFishingRod.h | 2 +- src/Items/ItemItemFrame.h | 2 +- src/Items/ItemPainting.h | 2 +- src/LoggerListeners.cpp | 14 +- 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 +- src/Root.cpp | 4 +- src/SetChunkData.cpp | 2 +- .../IncrementalRedstoneSimulator.cpp | 44 +++---- src/SpawnPrepare.cpp | 4 +- src/World.cpp | 36 +++--- src/WorldStorage/WSSAnvil.cpp | 142 ++++++++++----------- src/main.cpp | 6 +- tests/HTTP/UrlClientTest.cpp | 8 +- 35 files changed, 252 insertions(+), 257 deletions(-) diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index 3b9d30933..31493d4fe 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -1213,7 +1213,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cCallbackPtr & a_Callback) { if (a_Callback == nullptr) { - a_Callback = cpp14::make_unique(); + a_Callback = std::make_unique(); } return a_Callback->RefStack(*this, a_StackPos); } @@ -1235,7 +1235,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cOptionalCallbackPtr & a_Callback) { if (a_Callback == nullptr) { - a_Callback = cpp14::make_unique(); + a_Callback = std::make_unique(); } return a_Callback->RefStack(*this, a_StackPos); } @@ -1290,7 +1290,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cStackTablePtr & a_StackTable) } // Assign the StackTable to the specified stack position: - a_StackTable = cpp14::make_unique(*this, a_StackPos); + a_StackTable = std::make_unique(*this, a_StackPos); return true; } @@ -1311,7 +1311,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cTableRefPtr & a_TableRef) { if (a_TableRef == nullptr) { - a_TableRef = cpp14::make_unique(); + a_TableRef = std::make_unique(); } return a_TableRef->RefStack(*this, a_StackPos); } @@ -1333,7 +1333,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cTrackedRefPtr & a_Ref) { if (a_Ref == nullptr) { - a_Ref = cpp14::make_unique(); + a_Ref = std::make_unique(); } return a_Ref->RefStack(*this, a_StackPos); } diff --git a/src/Bindings/ManualBindings_Network.cpp b/src/Bindings/ManualBindings_Network.cpp index 4a7dd2367..911e1a8bb 100644 --- a/src/Bindings/ManualBindings_Network.cpp +++ b/src/Bindings/ManualBindings_Network.cpp @@ -967,7 +967,7 @@ static int tolua_cUrlClient_Request_Common(lua_State * a_LuaState, const AString { return L.ApiParamError("Cannot read the CallbacksTable parameter at idx %d", a_UrlStackIdx + 1); } - urlClientCallbacks = cpp14::make_unique(std::move(callbacks)); + urlClientCallbacks = std::make_unique(std::move(callbacks)); } else if (lua_isfunction(L, a_UrlStackIdx + 1)) { @@ -975,7 +975,7 @@ static int tolua_cUrlClient_Request_Common(lua_State * a_LuaState, const AString { return L.ApiParamError("Cannot read the CallbackFn parameter at idx %d", a_UrlStackIdx + 1); } - urlClientCallbacks = cpp14::make_unique(std::move(onCompleteBodyCallback)); + urlClientCallbacks = std::make_unique(std::move(onCompleteBodyCallback)); } else { diff --git a/src/Bindings/ManualBindings_World.cpp b/src/Bindings/ManualBindings_World.cpp index cfefb4f7a..8c73c5cd1 100644 --- a/src/Bindings/ManualBindings_World.cpp +++ b/src/Bindings/ManualBindings_World.cpp @@ -307,7 +307,7 @@ static int tolua_cWorld_ChunkStay(lua_State * tolua_S) ASSERT(chunkCoords != nullptr); // If the table was invalid, GetStackValues() would have failed // Read the chunk coords: - auto chunkStay = cpp14::make_unique(); + auto chunkStay = std::make_unique(); if (!chunkStay->AddChunks(*chunkCoords)) { return 0; @@ -732,7 +732,7 @@ static int tolua_cWorld_PrepareChunk(lua_State * tolua_S) cWorld * world = nullptr; int chunkX = 0; int chunkZ = 0; - auto Callback = cpp14::make_unique(); + auto Callback = std::make_unique(); L.GetStackValues(1, world, chunkX, chunkZ, Callback->m_LuaCallback); if (world == nullptr) { diff --git a/src/BlockEntities/BlockEntity.cpp b/src/BlockEntities/BlockEntity.cpp index 52611dce9..b32785e3c 100644 --- a/src/BlockEntities/BlockEntity.cpp +++ b/src/BlockEntities/BlockEntity.cpp @@ -77,25 +77,25 @@ OwnedBlockEntity cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETY { switch (a_BlockType) { - case E_BLOCK_BEACON: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_BED: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_BREWING_STAND: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_CHEST: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_COMMAND_BLOCK: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_DISPENSER: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_DROPPER: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_ENDER_CHEST: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_FLOWER_POT: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_FURNACE: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_HEAD: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_HOPPER: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_JUKEBOX: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_LIT_FURNACE: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_MOB_SPAWNER: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_NOTE_BLOCK: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_SIGN_POST: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_TRAPPED_CHEST: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_WALLSIGN: return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_BEACON: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_BED: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_BREWING_STAND: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_CHEST: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_COMMAND_BLOCK: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_DISPENSER: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_DROPPER: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_ENDER_CHEST: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_FLOWER_POT: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_FURNACE: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_HEAD: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_HOPPER: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_JUKEBOX: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_LIT_FURNACE: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_MOB_SPAWNER: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_NOTE_BLOCK: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_SIGN_POST: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_TRAPPED_CHEST: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_WALLSIGN: return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, a_World); default: { LOGD("%s: Requesting creation of an unknown block entity - block type %d (%s)", diff --git a/src/Blocks/BlockFence.h b/src/Blocks/BlockFence.h index 25ac85eed..35a9b139a 100644 --- a/src/Blocks/BlockFence.h +++ b/src/Blocks/BlockFence.h @@ -107,7 +107,7 @@ public: // New knot? needs to init and produce sound effect else { - auto NewLeashKnot = cpp14::make_unique(a_BlockFace, a_BlockPos); + auto NewLeashKnot = std::make_unique(a_BlockFace, a_BlockPos); auto NewLeashKnotPtr = NewLeashKnot.get(); NewLeashKnotPtr->TiePlayersLeashedMobs(a_Player, KnotAlreadyExists); diff --git a/src/BrewingRecipes.cpp b/src/BrewingRecipes.cpp index 829660ffe..7bce72883 100644 --- a/src/BrewingRecipes.cpp +++ b/src/BrewingRecipes.cpp @@ -64,7 +64,7 @@ void cBrewingRecipes::AddRecipeFromLine(AString a_Line, unsigned int a_LineNum) { a_Line.erase(std::remove_if(a_Line.begin(), a_Line.end(), isspace), a_Line.end()); - auto Recipe = cpp14::make_unique(); + auto Recipe = std::make_unique(); const AStringVector & InputAndIngredient = StringSplit(a_Line, "+"); @@ -145,7 +145,7 @@ const cBrewingRecipes::cRecipe * cBrewingRecipes::GetRecipeFrom(const cItem & a_ if (a_Input.m_ItemDamage & 0x2000) { // Create new recipe and add it to list - auto Recipe = cpp14::make_unique(); + auto Recipe = std::make_unique(); Recipe->Input.m_ItemType = a_Input.m_ItemDamage; Recipe->Output.m_ItemDamage = a_Input.m_ItemDamage + 8192; @@ -178,7 +178,7 @@ const cBrewingRecipes::cRecipe * cBrewingRecipes::GetRecipeFrom(const cItem & a_ } // Create new recipe and add it to list - auto Recipe = cpp14::make_unique(); + auto Recipe = std::make_unique(); Recipe->Input.m_ItemDamage = a_Input.m_ItemDamage; Recipe->Output.m_ItemDamage = (*FoundRecipe)->Output.m_ItemDamage + 8192; diff --git a/src/ChunkDataCallback.h b/src/ChunkDataCallback.h index c26ec5beb..0f120bfb1 100644 --- a/src/ChunkDataCallback.h +++ b/src/ChunkDataCallback.h @@ -115,7 +115,7 @@ public: }; cChunkDataCopyCollector(): - m_Pool(cpp14::make_unique(), 0, cChunkData::NumSections), // Keep 1 chunk worth of reserve + m_Pool(std::make_unique(), 0, cChunkData::NumSections), // Keep 1 chunk worth of reserve m_Data(m_Pool) { } diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 9a3baa609..e548a02e8 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -39,8 +39,8 @@ cChunkMap::cChunkMap(cWorld * a_World) : m_World(a_World), m_Pool( - cpp14::make_unique>( - cpp14::make_unique(), 1600u, 5000u + std::make_unique>( + std::make_unique(), 1600u, 5000u ) ) { @@ -71,7 +71,7 @@ cChunkPtr cChunkMap::ConstructChunk(int a_ChunkX, int a_ChunkZ) return ( *m_Chunks.emplace( ChunkCoordinate{ a_ChunkX, a_ChunkZ }, - cpp14::make_unique( + std::make_unique( a_ChunkX, a_ChunkZ, this, diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp index dc0af8647..ec05258ae 100644 --- a/src/ChunkSender.cpp +++ b/src/ChunkSender.cpp @@ -236,7 +236,7 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, std::unordered_set(*this, m_World)); + m_World.QueueLightChunk(a_ChunkX, a_ChunkZ, std::make_unique(*this, m_World)); return; } diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 15b7238fe..9dc1274d1 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -356,7 +356,7 @@ void cClientHandle::FinishAuthenticate(const AString & a_Name, const cUUID & a_U cWorld * World; { // Spawn player (only serversided, so data is loaded) - m_PlayerPtr = cpp14::make_unique(m_Self, GetUsername()); + m_PlayerPtr = std::make_unique(m_Self, GetUsername()); m_Player = m_PlayerPtr.get(); /* LOGD("Created a new cPlayer object at %p for client %s @ %s (%p)", diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp index 7cd41ec97..d08a3943c 100644 --- a/src/CraftingRecipes.cpp +++ b/src/CraftingRecipes.cpp @@ -464,7 +464,7 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine return; } - std::unique_ptr Recipe = cpp14::make_unique(); + std::unique_ptr Recipe = std::make_unique(); AStringVector RecipeSplit = StringSplit(Sides[0], ":"); const auto * resultPart = &RecipeSplit[0]; @@ -852,7 +852,7 @@ cCraftingRecipes::cRecipe * cCraftingRecipes::MatchRecipe(const cItem * a_Crafti } // for y, for x // The recipe has matched. Create a copy of the recipe and set its coords to match the crafting grid: - std::unique_ptr Recipe = cpp14::make_unique(); + std::unique_ptr Recipe = std::make_unique(); Recipe->m_Result = a_Recipe->m_Result; Recipe->m_Width = a_Recipe->m_Width; Recipe->m_Height = a_Recipe->m_Height; diff --git a/src/Entities/EntityEffect.cpp b/src/Entities/EntityEffect.cpp index 9475a1710..ef38e3a80 100644 --- a/src/Entities/EntityEffect.cpp +++ b/src/Entities/EntityEffect.cpp @@ -191,31 +191,31 @@ std::unique_ptr cEntityEffect::CreateEntityEffect(cEntityEffect:: { switch (a_EffectType) { - case cEntityEffect::effNoEffect: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - - case cEntityEffect::effAbsorption: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effBlindness: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effFireResistance: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effHaste: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effHealthBoost: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effHunger: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effInstantDamage: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effInstantHealth: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effInvisibility: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effJumpBoost: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effMiningFatigue: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effNausea: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effNightVision: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effPoison: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effRegeneration: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effResistance: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effSaturation: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effSlowness: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effSpeed: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effStrength: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effWaterBreathing: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effWeakness: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effWither: return cpp14::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effNoEffect: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + + case cEntityEffect::effAbsorption: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effBlindness: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effFireResistance: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effHaste: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effHealthBoost: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effHunger: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effInstantDamage: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effInstantHealth: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effInvisibility: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effJumpBoost: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effMiningFatigue: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effNausea: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effNightVision: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effPoison: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effRegeneration: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effResistance: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effSaturation: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effSlowness: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effSpeed: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effStrength: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effWaterBreathing: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effWeakness: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effWither: return std::make_unique(a_Duration, a_Intensity, a_DistanceModifier); } UNREACHABLE("Unsupported entity effect"); } diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index a8ba83b5d..1887e32a6 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -264,15 +264,15 @@ std::unique_ptr cProjectileEntity::Create( switch (a_Kind) { - case pkArrow: return cpp14::make_unique (a_Creator, a_Pos, Speed); - case pkEgg: return cpp14::make_unique (a_Creator, a_Pos, Speed); - case pkEnderPearl: return cpp14::make_unique(a_Creator, a_Pos, Speed); - case pkSnowball: return cpp14::make_unique (a_Creator, a_Pos, Speed); - case pkGhastFireball: return cpp14::make_unique (a_Creator, a_Pos, Speed); - case pkFireCharge: return cpp14::make_unique (a_Creator, a_Pos, Speed); - case pkExpBottle: return cpp14::make_unique (a_Creator, a_Pos, Speed); - case pkSplashPotion: return cpp14::make_unique (a_Creator, a_Pos, Speed, *a_Item); - case pkWitherSkull: return cpp14::make_unique (a_Creator, a_Pos, Speed); + case pkArrow: return std::make_unique (a_Creator, a_Pos, Speed); + case pkEgg: return std::make_unique (a_Creator, a_Pos, Speed); + case pkEnderPearl: return std::make_unique(a_Creator, a_Pos, Speed); + case pkSnowball: return std::make_unique (a_Creator, a_Pos, Speed); + case pkGhastFireball: return std::make_unique (a_Creator, a_Pos, Speed); + case pkFireCharge: return std::make_unique (a_Creator, a_Pos, Speed); + case pkExpBottle: return std::make_unique (a_Creator, a_Pos, Speed); + case pkSplashPotion: return std::make_unique (a_Creator, a_Pos, Speed, *a_Item); + case pkWitherSkull: return std::make_unique (a_Creator, a_Pos, Speed); case pkFirework: { ASSERT(a_Item != nullptr); @@ -281,7 +281,7 @@ std::unique_ptr cProjectileEntity::Create( return nullptr; } - return cpp14::make_unique(a_Creator, a_Pos, *a_Item); + return std::make_unique(a_Creator, a_Pos, *a_Item); } } diff --git a/src/FurnaceRecipe.cpp b/src/FurnaceRecipe.cpp index 4e642cccd..621a47a31 100644 --- a/src/FurnaceRecipe.cpp +++ b/src/FurnaceRecipe.cpp @@ -117,7 +117,7 @@ void cFurnaceRecipe::AddFuelFromLine(const AString & a_Line, unsigned int a_Line Line.erase(Line.begin()); // Remove the beginning "!" Line.erase(std::remove_if(Line.begin(), Line.end(), isspace), Line.end()); - std::unique_ptr Item = cpp14::make_unique(); + std::unique_ptr Item = std::make_unique(); int BurnTime; const AStringVector & Sides = StringSplit(Line, "="); @@ -160,8 +160,8 @@ void cFurnaceRecipe::AddRecipeFromLine(const AString & a_Line, unsigned int a_Li int CookTime = 200; float Reward = 0; - std::unique_ptr InputItem = cpp14::make_unique(); - std::unique_ptr OutputItem = cpp14::make_unique(); + std::unique_ptr InputItem = std::make_unique(); + std::unique_ptr OutputItem = std::make_unique(); const AStringVector & Sides = StringSplit(Line, "="); if (Sides.size() != 2) diff --git a/src/Generating/PieceGeneratorBFSTree.cpp b/src/Generating/PieceGeneratorBFSTree.cpp index b6929d4b0..4d9c78b45 100644 --- a/src/Generating/PieceGeneratorBFSTree.cpp +++ b/src/Generating/PieceGeneratorBFSTree.cpp @@ -177,7 +177,7 @@ bool cPieceGeneratorBFSTree::TryPlacePieceAtConnector( // Place the piece: Vector3i NewPos = Conn.m_Piece->RotatePos(Conn.m_Connector.m_Pos, Conn.m_NumCCWRotations); ConnPos -= NewPos; - auto PlacedPiece = cpp14::make_unique(&a_ParentPiece, *(Conn.m_Piece), ConnPos, Conn.m_NumCCWRotations); + auto PlacedPiece = std::make_unique(&a_ParentPiece, *(Conn.m_Piece), ConnPos, Conn.m_NumCCWRotations); // Add the new piece's connectors to the list of free connectors: cPiece::cConnectors Connectors = Conn.m_Piece->GetConnectors(); diff --git a/src/Generating/PrefabPiecePool.cpp b/src/Generating/PrefabPiecePool.cpp index d984912cb..e52bb1621 100644 --- a/src/Generating/PrefabPiecePool.cpp +++ b/src/Generating/PrefabPiecePool.cpp @@ -398,7 +398,7 @@ std::unique_ptr cPrefabPiecePool::LoadPrefabFromCubesetVer1( ); return nullptr; } - return cpp14::make_unique(area); + return std::make_unique(area); } // if (SchematicFileName) // There's no referenced schematic file, load from BlockDefinitions / BlockData. @@ -452,7 +452,7 @@ std::unique_ptr cPrefabPiecePool::LoadPrefabFromCubesetVer1( return nullptr; } - return cpp14::make_unique(BlockDefStr, BlockDataStr, SizeX, SizeY, SizeZ); + return std::make_unique(BlockDefStr, BlockDataStr, SizeX, SizeY, SizeZ); } diff --git a/src/Globals.h b/src/Globals.h index 114991129..c29f3200a 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -327,12 +327,7 @@ typename std::enable_if::value, C>::type CeilC(T a_Value) -// TODO: Replace cpp14 with std at point of use -namespace cpp14 -{ -using std::make_unique; -} // a tick is 50 ms using cTickTime = std::chrono::duration>>; diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index b7a9ef638..636df5753 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -70,7 +70,7 @@ public: } // Create the arrow entity: - auto Arrow = cpp14::make_unique(*a_Player, Force * 2); + auto Arrow = std::make_unique(*a_Player, Force * 2); auto ArrowPtr = Arrow.get(); if (!ArrowPtr->Initialize(std::move(Arrow), *a_Player->GetWorld())) { diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h index 8817c8c38..008ecd01e 100644 --- a/src/Items/ItemFishingRod.h +++ b/src/Items/ItemFishingRod.h @@ -88,7 +88,7 @@ public: // Cast a hook: auto & Random = GetRandomProvider(); auto CountDownTime = Random.RandInt(100, 900) - static_cast(a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLure) * 100); - auto Floater = cpp14::make_unique( + auto Floater = std::make_unique( a_Player->GetEyePosition(), a_Player->GetLookVector() * 15, a_Player->GetUniqueID(), CountDownTime diff --git a/src/Items/ItemItemFrame.h b/src/Items/ItemItemFrame.h index 2c191a003..f1f687461 100644 --- a/src/Items/ItemItemFrame.h +++ b/src/Items/ItemItemFrame.h @@ -49,7 +49,7 @@ public: } // Place the item frame: - auto ItemFrame = cpp14::make_unique(a_ClickedBlockFace, PlacePos); + auto ItemFrame = std::make_unique(a_ClickedBlockFace, PlacePos); auto ItemFramePtr = ItemFrame.get(); if (!ItemFramePtr->Initialize(std::move(ItemFrame), *a_World)) { diff --git a/src/Items/ItemPainting.h b/src/Items/ItemPainting.h index cc1d02ac4..78d9f040a 100644 --- a/src/Items/ItemPainting.h +++ b/src/Items/ItemPainting.h @@ -85,7 +85,7 @@ public: }; auto PaintingTitle = gPaintingTitlesList[a_World->GetTickRandomNumber(ARRAYCOUNT(gPaintingTitlesList) - 1)]; - auto Painting = cpp14::make_unique(PaintingTitle, a_ClickedBlockFace, PlacePos); + auto Painting = std::make_unique(PaintingTitle, a_ClickedBlockFace, PlacePos); auto PaintingPtr = Painting.get(); if (!PaintingPtr->Initialize(std::move(Painting), *a_World)) { diff --git a/src/LoggerListeners.cpp b/src/LoggerListeners.cpp index b7c8fbb38..19b8c82d7 100644 --- a/src/LoggerListeners.cpp +++ b/src/LoggerListeners.cpp @@ -211,7 +211,7 @@ std::unique_ptr MakeConsoleListener(bool a_IsService) { if (a_IsService) { - return cpp14::make_unique(); + return std::make_unique(); } #ifdef _WIN32 @@ -223,24 +223,24 @@ std::unique_ptr MakeConsoleListener(bool a_IsService) HANDLE Console = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(Console, &sbi); WORD DefaultConsoleAttrib = sbi.wAttributes; - return cpp14::make_unique(Console, DefaultConsoleAttrib); + return std::make_unique(Console, DefaultConsoleAttrib); } else { - return cpp14::make_unique(); + return std::make_unique(); } #elif defined (__linux) || defined (__APPLE__) // TODO: lookup terminal in terminfo if (isatty(fileno(stdout))) { - return cpp14::make_unique(); + return std::make_unique(); } else { - return cpp14::make_unique(); + return std::make_unique(); } #else - return cpp14::make_unique(); + return std::make_unique(); #endif } @@ -323,7 +323,7 @@ private: std::pair> MakeFileListener() { - auto listener = cpp14::make_unique(); + auto listener = std::make_unique(); if (!listener->Open()) { return {false, nullptr}; 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)); diff --git a/src/Root.cpp b/src/Root.cpp index 8b8df817d..4b40fd983 100644 --- a/src/Root.cpp +++ b/src/Root.cpp @@ -177,7 +177,7 @@ void cRoot::Start(std::unique_ptr a_OverridesRepo) m_SettingsFilename = a_OverridesRepo->GetValue("Server","ConfigFile"); } - auto IniFile = cpp14::make_unique(); + auto IniFile = std::make_unique(); bool IsNewIniFile = !IniFile->ReadFile(m_SettingsFilename); if (IsNewIniFile) @@ -187,7 +187,7 @@ void cRoot::Start(std::unique_ptr a_OverridesRepo) IniFile->AddHeaderComment(" Most of the settings here can be configured using the webadmin interface, if enabled in webadmin.ini"); } - auto settingsRepo = cpp14::make_unique(std::move(IniFile), std::move(a_OverridesRepo)); + auto settingsRepo = std::make_unique(std::move(IniFile), std::move(a_OverridesRepo)); LOG("Starting server..."); diff --git a/src/SetChunkData.cpp b/src/SetChunkData.cpp index d27e53d1c..8f850dec4 100644 --- a/src/SetChunkData.cpp +++ b/src/SetChunkData.cpp @@ -26,7 +26,7 @@ struct sMemCallbacks: cSetChunkData::cSetChunkData(int a_ChunkX, int a_ChunkZ, bool a_ShouldMarkDirty) : m_ChunkX(a_ChunkX), m_ChunkZ(a_ChunkZ), - m_Pool(cpp14::make_unique(), 0u, cChunkData::NumSections), + m_Pool(std::make_unique(), 0u, cChunkData::NumSections), m_ChunkData(m_Pool), m_IsLightValid(false), m_IsHeightMapValid(false), diff --git a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp index c4aa0a94b..fdcd69069 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp @@ -60,18 +60,18 @@ std::unique_ptr cIncrementalRedstoneSimulator::CreateComponent { case E_BLOCK_ACTIVATOR_RAIL: case E_BLOCK_DETECTOR_RAIL: - case E_BLOCK_POWERED_RAIL: return cpp14::make_unique(); + case E_BLOCK_POWERED_RAIL: return std::make_unique(); case E_BLOCK_ACTIVE_COMPARATOR: - case E_BLOCK_INACTIVE_COMPARATOR: return cpp14::make_unique(); + case E_BLOCK_INACTIVE_COMPARATOR: return std::make_unique(); case E_BLOCK_DISPENSER: - case E_BLOCK_DROPPER: return cpp14::make_unique(); + case E_BLOCK_DROPPER: return std::make_unique(); case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE: case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE: case E_BLOCK_STONE_PRESSURE_PLATE: - case E_BLOCK_WOODEN_PRESSURE_PLATE: return cpp14::make_unique(); + case E_BLOCK_WOODEN_PRESSURE_PLATE: return std::make_unique(); case E_BLOCK_ACACIA_FENCE_GATE: case E_BLOCK_BIRCH_FENCE_GATE: @@ -80,44 +80,44 @@ std::unique_ptr cIncrementalRedstoneSimulator::CreateComponent case E_BLOCK_IRON_TRAPDOOR: case E_BLOCK_JUNGLE_FENCE_GATE: case E_BLOCK_SPRUCE_FENCE_GATE: - case E_BLOCK_TRAPDOOR: return cpp14::make_unique(); + case E_BLOCK_TRAPDOOR: return std::make_unique(); case E_BLOCK_REDSTONE_LAMP_OFF: - case E_BLOCK_REDSTONE_LAMP_ON: return cpp14::make_unique(); + case E_BLOCK_REDSTONE_LAMP_ON: return std::make_unique(); case E_BLOCK_REDSTONE_REPEATER_OFF: - case E_BLOCK_REDSTONE_REPEATER_ON: return cpp14::make_unique(); + case E_BLOCK_REDSTONE_REPEATER_ON: return std::make_unique(); case E_BLOCK_REDSTONE_TORCH_OFF: - case E_BLOCK_REDSTONE_TORCH_ON: return cpp14::make_unique(); + case E_BLOCK_REDSTONE_TORCH_ON: return std::make_unique(); - case E_BLOCK_OBSERVER: return cpp14::make_unique(); + case E_BLOCK_OBSERVER: return std::make_unique(); case E_BLOCK_PISTON: - case E_BLOCK_STICKY_PISTON: return cpp14::make_unique(); + case E_BLOCK_STICKY_PISTON: return std::make_unique(); case E_BLOCK_LEVER: case E_BLOCK_STONE_BUTTON: - case E_BLOCK_WOODEN_BUTTON: return cpp14::make_unique(); - - case E_BLOCK_BLOCK_OF_REDSTONE: return cpp14::make_unique(); - case E_BLOCK_COMMAND_BLOCK: return cpp14::make_unique(); - case E_BLOCK_HOPPER: return cpp14::make_unique(); - case E_BLOCK_NOTE_BLOCK: return cpp14::make_unique(); - case E_BLOCK_REDSTONE_WIRE: return cpp14::make_unique(); - case E_BLOCK_TNT: return cpp14::make_unique(); - case E_BLOCK_TRAPPED_CHEST: return cpp14::make_unique(); - case E_BLOCK_TRIPWIRE_HOOK: return cpp14::make_unique(); + case E_BLOCK_WOODEN_BUTTON: return std::make_unique(); + + case E_BLOCK_BLOCK_OF_REDSTONE: return std::make_unique(); + case E_BLOCK_COMMAND_BLOCK: return std::make_unique(); + case E_BLOCK_HOPPER: return std::make_unique(); + case E_BLOCK_NOTE_BLOCK: return std::make_unique(); + case E_BLOCK_REDSTONE_WIRE: return std::make_unique(); + case E_BLOCK_TNT: return std::make_unique(); + case E_BLOCK_TRAPPED_CHEST: return std::make_unique(); + case E_BLOCK_TRIPWIRE_HOOK: return std::make_unique(); default: { if (cBlockDoorHandler::IsDoorBlockType(a_BlockType)) { - return cpp14::make_unique(); + return std::make_unique(); } if (cBlockInfo::FullyOccupiesVoxel(a_BlockType)) { - return cpp14::make_unique(); + return std::make_unique(); } return nullptr; } diff --git a/src/SpawnPrepare.cpp b/src/SpawnPrepare.cpp index e9f9e3b09..d79e12754 100644 --- a/src/SpawnPrepare.cpp +++ b/src/SpawnPrepare.cpp @@ -59,7 +59,7 @@ void cSpawnPrepare::PrepareChunks(cWorld & a_World, int a_SpawnChunkX, int a_Spa { int chunkX, chunkZ; prep->DecodeChunkCoords(i, chunkX, chunkZ); - a_World.PrepareChunk(chunkX, chunkZ, cpp14::make_unique(prep)); + a_World.PrepareChunk(chunkX, chunkZ, std::make_unique(prep)); } // for i // Wait for the lighting thread to prepare everything. Event is set in the Call() callback: @@ -107,7 +107,7 @@ void cSpawnPrepare::PreparedChunkCallback(int a_ChunkX, int a_ChunkZ) { int chunkX, chunkZ; DecodeChunkCoords(m_NextIdx, chunkX, chunkZ); - m_World.GetLightingThread().QueueChunk(chunkX, chunkZ, cpp14::make_unique(shared_from_this())); + m_World.GetLightingThread().QueueChunk(chunkX, chunkZ, std::make_unique(shared_from_this())); m_NextIdx += 1; } diff --git a/src/World.cpp b/src/World.cpp index 6e7c066c9..d13081fb0 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -225,7 +225,7 @@ cWorld::cWorld( cFile::CreateFolderRecursive(m_DataPath); - m_ChunkMap = cpp14::make_unique(this); + m_ChunkMap = std::make_unique(this); m_ChunkMap->TrackInDeadlockDetect(a_DeadlockDetect, m_WorldName); // Load the scoreboard @@ -419,11 +419,11 @@ cWorld::cWorld( m_BlockTickQueueCopy.reserve(1000); // Simulators: - m_SimulatorManager = cpp14::make_unique(*this); + m_SimulatorManager = std::make_unique(*this); m_WaterSimulator = InitializeFluidSimulator(IniFile, "Water", E_BLOCK_WATER, E_BLOCK_STATIONARY_WATER); m_LavaSimulator = InitializeFluidSimulator(IniFile, "Lava", E_BLOCK_LAVA, E_BLOCK_STATIONARY_LAVA); - m_SandSimulator = cpp14::make_unique(*this, IniFile); - m_FireSimulator = cpp14::make_unique(*this, IniFile); + m_SandSimulator = std::make_unique(*this, IniFile); + m_FireSimulator = std::make_unique(*this, IniFile); m_RedstoneSimulator = InitializeRedstoneSimulator(IniFile); // Water, Lava and Redstone simulators get registered in their initialize function. @@ -1988,7 +1988,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, Vector3d a_Pos, double a float SpeedY = static_cast(a_FlyAwaySpeed * Random.RandInt(40, 50)); float SpeedZ = static_cast(a_FlyAwaySpeed * Random.RandInt(-10, 10)); - auto Pickup = cpp14::make_unique(a_Pos, *itr, a_IsPlayerCreated, Vector3f{SpeedX, SpeedY, SpeedZ}); + auto Pickup = std::make_unique(a_Pos, *itr, a_IsPlayerCreated, Vector3f{SpeedX, SpeedY, SpeedZ}); auto PickupPtr = Pickup.get(); PickupPtr->Initialize(std::move(Pickup), *this); } @@ -2007,7 +2007,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, Vector3d a_Pos, Vector3d continue; } - auto pickup = cpp14::make_unique(a_Pos, *itr, a_IsPlayerCreated, a_Speed); + auto pickup = std::make_unique(a_Pos, *itr, a_IsPlayerCreated, a_Speed); auto pickupPtr = pickup.get(); pickupPtr->Initialize(std::move(pickup), *this); } @@ -2019,7 +2019,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, Vector3d a_Pos, Vector3d UInt32 cWorld::SpawnItemPickup(Vector3d a_Pos, const cItem & a_Item, Vector3f a_Speed, int a_LifetimeTicks, bool a_CanCombine) { - auto pickup = cpp14::make_unique(a_Pos, a_Item, false, a_Speed, a_LifetimeTicks, a_CanCombine); + auto pickup = std::make_unique(a_Pos, a_Item, false, a_Speed, a_LifetimeTicks, a_CanCombine); auto pickupPtr = pickup.get(); if (!pickupPtr->Initialize(std::move(pickup), *this)) { @@ -2034,7 +2034,7 @@ UInt32 cWorld::SpawnItemPickup(Vector3d a_Pos, const cItem & a_Item, Vector3f a_ UInt32 cWorld::SpawnFallingBlock(Vector3d a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { - auto fallingBlock = cpp14::make_unique(a_Pos, a_BlockType, a_BlockMeta); + auto fallingBlock = std::make_unique(a_Pos, a_BlockType, a_BlockMeta); auto fallingBlockPtr = fallingBlock.get(); auto ID = fallingBlock->GetUniqueID(); if (!fallingBlockPtr->Initialize(std::move(fallingBlock), *this)) @@ -2056,7 +2056,7 @@ UInt32 cWorld::SpawnExperienceOrb(Vector3d a_Pos, int a_Reward) return cEntity::INVALID_ID; } - auto expOrb = cpp14::make_unique(a_Pos, a_Reward); + auto expOrb = std::make_unique(a_Pos, a_Reward); auto expOrbPtr = expOrb.get(); if (!expOrbPtr->Initialize(std::move(expOrb), *this)) { @@ -2091,7 +2091,7 @@ std::vector cWorld::SpawnSplitExperienceOrbs(Vector3d a_Pos, int a_Rewar auto & Random = GetRandomProvider(); for (auto Reward : Rewards) { - auto ExpOrb = cpp14::make_unique(a_Pos, Reward); + auto ExpOrb = std::make_unique(a_Pos, Reward); auto ExpOrbPtr = ExpOrb.get(); double SpeedX = Random.RandReal(-SpeedLimit, SpeedLimit); double SpeedY = Random.RandReal(0.5); @@ -2117,11 +2117,11 @@ UInt32 cWorld::SpawnMinecart(Vector3d a_Pos, int a_MinecartType, const cItem & a std::unique_ptr Minecart; switch (a_MinecartType) { - case E_ITEM_MINECART: Minecart = cpp14::make_unique (a_Pos, a_Content, a_BlockHeight); break; - case E_ITEM_CHEST_MINECART: Minecart = cpp14::make_unique (a_Pos); break; - case E_ITEM_FURNACE_MINECART: Minecart = cpp14::make_unique(a_Pos); break; - case E_ITEM_MINECART_WITH_TNT: Minecart = cpp14::make_unique (a_Pos); break; - case E_ITEM_MINECART_WITH_HOPPER: Minecart = cpp14::make_unique (a_Pos); break; + case E_ITEM_MINECART: Minecart = std::make_unique (a_Pos, a_Content, a_BlockHeight); break; + case E_ITEM_CHEST_MINECART: Minecart = std::make_unique (a_Pos); break; + case E_ITEM_FURNACE_MINECART: Minecart = std::make_unique(a_Pos); break; + case E_ITEM_MINECART_WITH_TNT: Minecart = std::make_unique (a_Pos); break; + case E_ITEM_MINECART_WITH_HOPPER: Minecart = std::make_unique (a_Pos); break; default: { return cEntity::INVALID_ID; @@ -2142,7 +2142,7 @@ UInt32 cWorld::SpawnMinecart(Vector3d a_Pos, int a_MinecartType, const cItem & a UInt32 cWorld::SpawnBoat(Vector3d a_Pos, cBoat::eMaterial a_Material) { - auto Boat = cpp14::make_unique(a_Pos, a_Material); + auto Boat = std::make_unique(a_Pos, a_Material); auto BoatPtr = Boat.get(); if (!BoatPtr->Initialize(std::move(Boat), *this)) { @@ -2157,7 +2157,7 @@ UInt32 cWorld::SpawnBoat(Vector3d a_Pos, cBoat::eMaterial a_Material) UInt32 cWorld::SpawnPrimedTNT(Vector3d a_Pos, int a_FuseTicks, double a_InitialVelocityCoeff, bool a_ShouldPlayFuseSound) { - auto TNT = cpp14::make_unique(a_Pos, a_FuseTicks); + auto TNT = std::make_unique(a_Pos, a_FuseTicks); auto TNTPtr = TNT.get(); if (!TNTPtr->Initialize(std::move(TNT), *this)) { @@ -3594,7 +3594,7 @@ void cWorld::cChunkGeneratorCallbacks::OnChunkGenerated(cChunkDesc & a_ChunkDesc cChunkDef::BlockNibbles BlockMetas; a_ChunkDesc.CompressBlockMetas(BlockMetas); - auto SetChunkData = cpp14::make_unique( + auto SetChunkData = std::make_unique( a_ChunkDesc.GetChunkX(), a_ChunkDesc.GetChunkZ(), a_ChunkDesc.GetBlockTypes(), BlockMetas, nullptr, nullptr, // We don't have lighting, chunk will be lighted when needed diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 7ddc8a2e4..a77f10ae7 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -462,7 +462,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT } // for y //*/ - auto SetChunkData = cpp14::make_unique( + auto SetChunkData = std::make_unique( a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, BlockTypes, MetaData, IsLightValid ? BlockLight : nullptr, @@ -900,7 +900,7 @@ OwnedBlockEntity cWSSAnvil::LoadBeaconFromNBT(const cParsedNBT & a_NBT, int a_Ta return nullptr; } - auto Beacon = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Beacon = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); int CurrentLine = a_NBT.FindChildByName(a_TagIdx, "Levels"); if (CurrentLine >= 0) @@ -952,7 +952,7 @@ OwnedBlockEntity cWSSAnvil::LoadBedFromNBT(const cParsedNBT & a_NBT, int a_TagId Color = static_cast(a_NBT.GetInt(ColorIDx)); } - return cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World, Color); + return std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World, Color); } @@ -974,7 +974,7 @@ OwnedBlockEntity cWSSAnvil::LoadBrewingstandFromNBT(const cParsedNBT & a_NBT, in return nullptr; // Make it an empty brewingstand - the chunk loader will provide an empty cBrewingstandEntity for this } - auto Brewingstand = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Brewingstand = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); // Fuel has to be loaded at first, because of slot events: int Fuel = a_NBT.FindChildByName(a_TagIdx, "Fuel"); @@ -1032,7 +1032,7 @@ OwnedBlockEntity cWSSAnvil::LoadChestFromNBT(const cParsedNBT & a_NBT, int a_Tag { return nullptr; // Make it an empty chest - the chunk loader will provide an empty cChestEntity for this } - auto Chest = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Chest = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); LoadItemGridFromNBT(Chest->GetContents(), a_NBT, Items); return std::move(Chest); } @@ -1050,7 +1050,7 @@ OwnedBlockEntity cWSSAnvil::LoadCommandBlockFromNBT(const cParsedNBT & a_NBT, in return nullptr; } - auto CmdBlock = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto CmdBlock = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); int currentLine = a_NBT.FindChildByName(a_TagIdx, "Command"); if (currentLine >= 0) @@ -1093,7 +1093,7 @@ OwnedBlockEntity cWSSAnvil::LoadDispenserFromNBT(const cParsedNBT & a_NBT, int a { return nullptr; // Make it an empty dispenser - the chunk loader will provide an empty cDispenserEntity for this } - auto Dispenser = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Dispenser = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); LoadItemGridFromNBT(Dispenser->GetContents(), a_NBT, Items); return std::move(Dispenser); } @@ -1116,7 +1116,7 @@ OwnedBlockEntity cWSSAnvil::LoadDropperFromNBT(const cParsedNBT & a_NBT, int a_T { return nullptr; // Make it an empty dropper - the chunk loader will provide an empty cDropperEntity for this } - auto Dropper = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Dropper = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); LoadItemGridFromNBT(Dropper->GetContents(), a_NBT, Items); return std::move(Dropper); } @@ -1134,7 +1134,7 @@ OwnedBlockEntity cWSSAnvil::LoadFlowerPotFromNBT(const cParsedNBT & a_NBT, int a return nullptr; } - auto FlowerPot = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto FlowerPot = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); cItem Item; int currentLine = a_NBT.FindChildByName(a_TagIdx, "Item"); @@ -1179,7 +1179,7 @@ OwnedBlockEntity cWSSAnvil::LoadFurnaceFromNBT(const cParsedNBT & a_NBT, int a_T return nullptr; // Make it an empty furnace - the chunk loader will provide an empty cFurnaceEntity for this } - auto Furnace = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Furnace = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); Furnace->SetLoading(true); // Load slots: @@ -1238,7 +1238,7 @@ OwnedBlockEntity cWSSAnvil::LoadHopperFromNBT(const cParsedNBT & a_NBT, int a_Ta { return nullptr; // Make it an empty hopper - the chunk loader will provide an empty cHopperEntity for this } - auto Hopper = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Hopper = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); LoadItemGridFromNBT(Hopper->GetContents(), a_NBT, Items); return std::move(Hopper); } @@ -1256,7 +1256,7 @@ OwnedBlockEntity cWSSAnvil::LoadJukeboxFromNBT(const cParsedNBT & a_NBT, int a_T return nullptr; } - auto Jukebox = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Jukebox = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); int Record = a_NBT.FindChildByName(a_TagIdx, "Record"); if (Record >= 0) { @@ -1278,7 +1278,7 @@ OwnedBlockEntity cWSSAnvil::LoadMobSpawnerFromNBT(const cParsedNBT & a_NBT, int return nullptr; } - auto MobSpawner = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto MobSpawner = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); // Load entity (Cuberite worlds): int Type = a_NBT.FindChildByName(a_TagIdx, "Entity"); @@ -1327,7 +1327,7 @@ OwnedBlockEntity cWSSAnvil::LoadMobHeadFromNBT(const cParsedNBT & a_NBT, int a_T return nullptr; } - auto MobHead = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto MobHead = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); int currentLine = a_NBT.FindChildByName(a_TagIdx, "SkullType"); if (currentLine >= 0) @@ -1401,7 +1401,7 @@ OwnedBlockEntity cWSSAnvil::LoadNoteBlockFromNBT(const cParsedNBT & a_NBT, int a return nullptr; } - auto NoteBlock = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto NoteBlock = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); int note = a_NBT.FindChildByName(a_TagIdx, "note"); if (note >= 0) { @@ -1423,7 +1423,7 @@ OwnedBlockEntity cWSSAnvil::LoadSignFromNBT(const cParsedNBT & a_NBT, int a_TagI return nullptr; } - auto Sign = cpp14::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Sign = std::make_unique(a_BlockType, a_BlockMeta, a_Pos, m_World); int currentLine = a_NBT.FindChildByName(a_TagIdx, "Text1"); if (currentLine >= 0) @@ -1611,7 +1611,7 @@ void cWSSAnvil::LoadOldMinecartFromNBT(cEntityList & a_Entities, const cParsedNB void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Boat = cpp14::make_unique(Vector3d(), cBoat::bmOak); + auto Boat = std::make_unique(Vector3d(), cBoat::bmOak); if (!LoadEntityBaseFromNBT(*Boat.get(), a_NBT, a_TagIdx)) { return; @@ -1631,7 +1631,7 @@ void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N void cWSSAnvil::LoadEnderCrystalFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto EnderCrystal = cpp14::make_unique(Vector3d()); + auto EnderCrystal = std::make_unique(Vector3d()); if (!LoadEntityBaseFromNBT(*EnderCrystal.get(), a_NBT, a_TagIdx)) { return; @@ -1656,7 +1656,7 @@ void cWSSAnvil::LoadFallingBlockFromNBT(cEntityList & a_Entities, const cParsedN BLOCKTYPE Type = static_cast(a_NBT.GetInt(TypeIdx)); NIBBLETYPE Meta = static_cast(a_NBT.GetByte(MetaIdx)); - auto FallingBlock = cpp14::make_unique(Vector3i(0, 0, 0), Type, Meta); + auto FallingBlock = std::make_unique(Vector3i(0, 0, 0), Type, Meta); if (!LoadEntityBaseFromNBT(*FallingBlock.get(), a_NBT, a_TagIdx)) { return; @@ -1670,7 +1670,7 @@ void cWSSAnvil::LoadFallingBlockFromNBT(cEntityList & a_Entities, const cParsedN void cWSSAnvil::LoadMinecartRFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Minecart = cpp14::make_unique(Vector3d(), cItem(), 1); // TODO: Load the block and the height + auto Minecart = std::make_unique(Vector3d(), cItem(), 1); // TODO: Load the block and the height if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1689,7 +1689,7 @@ void cWSSAnvil::LoadMinecartCFromNBT(cEntityList & a_Entities, const cParsedNBT { return; // Make it an empty chest - the chunk loader will provide an empty cChestEntity for this } - auto Minecart = cpp14::make_unique(Vector3d()); + auto Minecart = std::make_unique(Vector3d()); if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1716,7 +1716,7 @@ void cWSSAnvil::LoadMinecartCFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadMinecartFFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Minecart = cpp14::make_unique(Vector3d()); + auto Minecart = std::make_unique(Vector3d()); if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1733,7 +1733,7 @@ void cWSSAnvil::LoadMinecartFFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadMinecartTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Minecart = cpp14::make_unique(Vector3d()); + auto Minecart = std::make_unique(Vector3d()); if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1750,7 +1750,7 @@ void cWSSAnvil::LoadMinecartTFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadMinecartHFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Minecart = cpp14::make_unique(Vector3d()); + auto Minecart = std::make_unique(Vector3d()); if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1779,7 +1779,7 @@ void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a return; } - auto Pickup = cpp14::make_unique(Vector3d(), Item, false); // Pickup delay doesn't matter, just say false + auto Pickup = std::make_unique(Vector3d(), Item, false); // Pickup delay doesn't matter, just say false if (!LoadEntityBaseFromNBT(*Pickup.get(), a_NBT, a_TagIdx)) { return; @@ -1801,7 +1801,7 @@ void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadTNTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto TNT = cpp14::make_unique(Vector3d(), 0); + auto TNT = std::make_unique(Vector3d(), 0); if (!LoadEntityBaseFromNBT(*TNT.get(), a_NBT, a_TagIdx)) { return; @@ -1823,7 +1823,7 @@ void cWSSAnvil::LoadTNTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB void cWSSAnvil::LoadExpOrbFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto ExpOrb = cpp14::make_unique(Vector3d(), 0); + auto ExpOrb = std::make_unique(Vector3d(), 0); if (!LoadEntityBaseFromNBT(*ExpOrb.get(), a_NBT, a_TagIdx)) { return; @@ -1892,7 +1892,7 @@ void cWSSAnvil::LoadItemFrameFromNBT(cEntityList & a_Entities, const cParsedNBT return; } - auto ItemFrame = cpp14::make_unique(BLOCK_FACE_NONE, Vector3d()); + auto ItemFrame = std::make_unique(BLOCK_FACE_NONE, Vector3d()); if (!LoadEntityBaseFromNBT(*ItemFrame.get(), a_NBT, a_TagIdx)) { return; @@ -1917,7 +1917,7 @@ void cWSSAnvil::LoadItemFrameFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadLeashKnotFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto LeashKnot = cpp14::make_unique(BLOCK_FACE_NONE, Vector3d()); + auto LeashKnot = std::make_unique(BLOCK_FACE_NONE, Vector3d()); if (!LoadEntityBaseFromNBT(*LeashKnot.get(), a_NBT, a_TagIdx)) { @@ -1942,7 +1942,7 @@ void cWSSAnvil::LoadPaintingFromNBT(cEntityList & a_Entities, const cParsedNBT & return; } - auto Painting = cpp14::make_unique(a_NBT.GetString(MotiveTag), BLOCK_FACE_NONE, Vector3d()); + auto Painting = std::make_unique(a_NBT.GetString(MotiveTag), BLOCK_FACE_NONE, Vector3d()); if (!LoadEntityBaseFromNBT(*Painting.get(), a_NBT, a_TagIdx)) { return; @@ -1958,7 +1958,7 @@ void cWSSAnvil::LoadPaintingFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Arrow = cpp14::make_unique(nullptr, Vector3d(), Vector3d()); + auto Arrow = std::make_unique(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Arrow.get(), a_NBT, a_TagIdx)) { return; @@ -2029,7 +2029,7 @@ void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadSplashPotionFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto SplashPotion = cpp14::make_unique(nullptr, Vector3d(), Vector3d(), cItem()); + auto SplashPotion = std::make_unique(nullptr, Vector3d(), Vector3d(), cItem()); if (!LoadProjectileBaseFromNBT(*SplashPotion.get(), a_NBT, a_TagIdx)) { return; @@ -2053,7 +2053,7 @@ void cWSSAnvil::LoadSplashPotionFromNBT(cEntityList & a_Entities, const cParsedN void cWSSAnvil::LoadSnowballFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Snowball = cpp14::make_unique(nullptr, Vector3d(), Vector3d()); + auto Snowball = std::make_unique(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Snowball.get(), a_NBT, a_TagIdx)) { return; @@ -2069,7 +2069,7 @@ void cWSSAnvil::LoadSnowballFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadEggFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Egg = cpp14::make_unique(nullptr, Vector3d(), Vector3d()); + auto Egg = std::make_unique(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Egg.get(), a_NBT, a_TagIdx)) { return; @@ -2085,7 +2085,7 @@ void cWSSAnvil::LoadEggFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB void cWSSAnvil::LoadFireballFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Fireball = cpp14::make_unique(nullptr, Vector3d(), Vector3d()); + auto Fireball = std::make_unique(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Fireball.get(), a_NBT, a_TagIdx)) { return; @@ -2101,7 +2101,7 @@ void cWSSAnvil::LoadFireballFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadFireChargeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto FireCharge = cpp14::make_unique(nullptr, Vector3d(), Vector3d()); + auto FireCharge = std::make_unique(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*FireCharge.get(), a_NBT, a_TagIdx)) { return; @@ -2117,7 +2117,7 @@ void cWSSAnvil::LoadFireChargeFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadThrownEnderpearlFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Enderpearl = cpp14::make_unique(nullptr, Vector3d(), Vector3d()); + auto Enderpearl = std::make_unique(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Enderpearl.get(), a_NBT, a_TagIdx)) { return; @@ -2133,7 +2133,7 @@ void cWSSAnvil::LoadThrownEnderpearlFromNBT(cEntityList & a_Entities, const cPar void cWSSAnvil::LoadBatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Monster = cpp14::make_unique(); + auto Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2153,7 +2153,7 @@ void cWSSAnvil::LoadBatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB void cWSSAnvil::LoadBlazeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2173,7 +2173,7 @@ void cWSSAnvil::LoadBlazeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadCaveSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2193,7 +2193,7 @@ void cWSSAnvil::LoadCaveSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadChickenFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2213,7 +2213,7 @@ void cWSSAnvil::LoadChickenFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadCowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2233,7 +2233,7 @@ void cWSSAnvil::LoadCowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB void cWSSAnvil::LoadCreeperFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2253,7 +2253,7 @@ void cWSSAnvil::LoadCreeperFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadEnderDragonFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2273,7 +2273,7 @@ void cWSSAnvil::LoadEnderDragonFromNBT(cEntityList & a_Entities, const cParsedNB void cWSSAnvil::LoadEndermanFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2293,7 +2293,7 @@ void cWSSAnvil::LoadEndermanFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadGhastFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2313,7 +2313,7 @@ void cWSSAnvil::LoadGhastFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadGiantFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2333,7 +2333,7 @@ void cWSSAnvil::LoadGiantFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadGuardianFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2365,7 +2365,7 @@ void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ int Color = a_NBT.GetInt(ColorIdx); int Style = a_NBT.GetInt(StyleIdx); - std::unique_ptr Monster = cpp14::make_unique(Type, Color, Style, 1); + std::unique_ptr Monster = std::make_unique(Type, Color, Style, 1); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { @@ -2399,7 +2399,7 @@ void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadIronGolemFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2428,7 +2428,7 @@ void cWSSAnvil::LoadMagmaCubeFromNBT(cEntityList & a_Entities, const cParsedNBT int Size = a_NBT.GetInt(SizeIdx); - std::unique_ptr Monster = cpp14::make_unique(Size); + std::unique_ptr Monster = std::make_unique(Size); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2448,7 +2448,7 @@ void cWSSAnvil::LoadMagmaCubeFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadMooshroomFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2468,7 +2468,7 @@ void cWSSAnvil::LoadMooshroomFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadOcelotFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2522,7 +2522,7 @@ void cWSSAnvil::LoadOcelotFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadPigFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2566,7 +2566,7 @@ void cWSSAnvil::LoadRabbitFromNBT(cEntityList & a_Entities, const cParsedNBT & a int Type = a_NBT.GetInt(TypeIdx); int MoreCarrotTicks = a_NBT.GetInt(MoreCarrotTicksIdx); - std::unique_ptr Monster = cpp14::make_unique(static_cast(Type), MoreCarrotTicks); + std::unique_ptr Monster = std::make_unique(static_cast(Type), MoreCarrotTicks); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2606,7 +2606,7 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ Color = static_cast(a_NBT.GetByte(ColorIdx)); } - std::unique_ptr Monster = cpp14::make_unique(Color); + std::unique_ptr Monster = std::make_unique(Color); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2645,7 +2645,7 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadSilverfishFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2672,11 +2672,11 @@ void cWSSAnvil::LoadSkeletonFromNBT(cEntityList & a_Entities, const cParsedNBT & std::unique_ptr Monster; if ((TypeIdx > 0) && (a_NBT.GetByte(TypeIdx) == 1)) { - Monster = cpp14::make_unique(); + Monster = std::make_unique(); } else { - Monster = cpp14::make_unique(); + Monster = std::make_unique(); } if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) @@ -2707,7 +2707,7 @@ void cWSSAnvil::LoadSlimeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ int Size = a_NBT.GetInt(SizeIdx); - std::unique_ptr Monster = cpp14::make_unique(Size); + std::unique_ptr Monster = std::make_unique(Size); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2727,7 +2727,7 @@ void cWSSAnvil::LoadSlimeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadSnowGolemFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2747,7 +2747,7 @@ void cWSSAnvil::LoadSnowGolemFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2767,7 +2767,7 @@ void cWSSAnvil::LoadSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadSquidFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2795,7 +2795,7 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT & int Type = a_NBT.GetInt(TypeIdx); - std::unique_ptr Monster = cpp14::make_unique(cVillager::eVillagerType(Type)); + std::unique_ptr Monster = std::make_unique(cVillager::eVillagerType(Type)); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2829,7 +2829,7 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadWitchFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2849,7 +2849,7 @@ void cWSSAnvil::LoadWitchFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadWitherFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2875,7 +2875,7 @@ void cWSSAnvil::LoadWitherFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadWitherSkeletonFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Monster = cpp14::make_unique(); + auto Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2895,7 +2895,7 @@ void cWSSAnvil::LoadWitherSkeletonFromNBT(cEntityList & a_Entities, const cParse void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2971,7 +2971,7 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N void cWSSAnvil::LoadZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -3004,7 +3004,7 @@ void cWSSAnvil::LoadZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadPigZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr Monster = cpp14::make_unique(); + std::unique_ptr Monster = std::make_unique(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -3045,7 +3045,7 @@ void cWSSAnvil::LoadZombieVillagerFromNBT(cEntityList & a_Entities, const cParse cVillager::eVillagerType Profession = static_cast(a_NBT.GetInt(ProfessionIdx)); - std::unique_ptr Monster = cpp14::make_unique(Profession); + std::unique_ptr Monster = std::make_unique(Profession); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; diff --git a/src/main.cpp b/src/main.cpp index 7411b410e..4d59fea0e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -256,7 +256,7 @@ static DWORD WINAPI serviceWorkerThread(LPVOID lpParam) while (!cRoot::m_TerminateEventRaised) { // Do the normal startup - UniversalMain(cpp14::make_unique()); + UniversalMain(std::make_unique()); } return ERROR_SUCCESS; @@ -380,7 +380,7 @@ static std::unique_ptr ParseArguments(int argc, char cmd.parse(argc, argv); // Copy the parsed args' values into a settings repository: - auto repo = cpp14::make_unique(); + auto repo = std::make_unique(); if (confArg.isSet()) { AString conf_file = confArg.getValue(); @@ -441,7 +441,7 @@ static std::unique_ptr ParseArguments(int argc, char catch (const TCLAP::ArgException & exc) { fmt::print("Error reading command line {0} for arg {1}", exc.error(), exc.argId()); - return cpp14::make_unique(); + return std::make_unique(); } } diff --git a/tests/HTTP/UrlClientTest.cpp b/tests/HTTP/UrlClientTest.cpp index 05844ca53..17f98ab70 100644 --- a/tests/HTTP/UrlClientTest.cpp +++ b/tests/HTTP/UrlClientTest.cpp @@ -114,7 +114,7 @@ int TestRequest1() { LOG("Running test 1"); auto evtFinished = std::make_shared(); - auto callbacks = cpp14::make_unique(evtFinished); + auto callbacks = std::make_unique(evtFinished); AStringMap options; options["MaxRedirects"] = "0"; auto res = cUrlClient::Get("http://github.com", std::move(callbacks), AStringMap(), AString(), options); @@ -138,7 +138,7 @@ int TestRequest2() { LOG("Running test 2"); auto evtFinished = std::make_shared(); - auto callbacks = cpp14::make_unique(evtFinished); + auto callbacks = std::make_unique(evtFinished); auto res = cUrlClient::Get("http://github.com", std::move(callbacks)); if (res.first) { @@ -160,7 +160,7 @@ int TestRequest3() { LOG("Running test 3"); auto evtFinished = std::make_shared(); - auto callbacks = cpp14::make_unique(evtFinished); + auto callbacks = std::make_unique(evtFinished); AStringMap options; options["MaxRedirects"] = "0"; auto res = cUrlClient::Get("https://github.com", std::move(callbacks), AStringMap(), AString(), options); @@ -184,7 +184,7 @@ int TestRequest4() { LOG("Running test 4"); auto evtFinished = std::make_shared(); - auto callbacks = cpp14::make_unique(evtFinished); + auto callbacks = std::make_unique(evtFinished); auto res = cUrlClient::Get("https://github.com", std::move(callbacks)); if (res.first) { -- cgit v1.2.3