diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/Collision/DynamicTree.cpp | 4 | ||||
-rw-r--r-- | src/common/Collision/Management/VMapManager2.cpp | 6 | ||||
-rw-r--r-- | src/common/Utilities/Optional.h | 8 | ||||
-rw-r--r-- | src/common/Utilities/OptionalFwd.h | 31 | ||||
-rw-r--r-- | src/common/Utilities/TaskScheduler.cpp | 2 | ||||
-rw-r--r-- | src/common/Utilities/TaskScheduler.h | 3 |
6 files changed, 13 insertions, 41 deletions
diff --git a/src/common/Collision/DynamicTree.cpp b/src/common/Collision/DynamicTree.cpp index bfe33c9eae7..35047464231 100644 --- a/src/common/Collision/DynamicTree.cpp +++ b/src/common/Collision/DynamicTree.cpp @@ -318,9 +318,9 @@ void DynamicMapTree::getAreaAndLiquidData(float x, float y, float z, uint32 phas float liquidLevel; if (!reqLiquidType || (dynamic_cast<VMAP::VMapManager2*>(VMAP::VMapFactory::createOrGetVMapManager())->GetLiquidFlagsPtr(liquidType) & reqLiquidType)) if (intersectionCallBack.GetHitModel()->GetLiquidLevel(v, intersectionCallBack.GetLocationInfo(), liquidLevel)) - data.liquidInfo = boost::in_place(liquidType, liquidLevel); + data.liquidInfo.emplace(liquidType, liquidLevel); - data.areaInfo = boost::in_place(0, + data.areaInfo.emplace(0, intersectionCallBack.GetLocationInfo().rootId, intersectionCallBack.GetLocationInfo().hitModel->GetWmoID(), intersectionCallBack.GetLocationInfo().hitModel->GetMogpFlags()); diff --git a/src/common/Collision/Management/VMapManager2.cpp b/src/common/Collision/Management/VMapManager2.cpp index 76ba7e7aeb7..04b0900a6b3 100644 --- a/src/common/Collision/Management/VMapManager2.cpp +++ b/src/common/Collision/Management/VMapManager2.cpp @@ -287,7 +287,7 @@ namespace VMAP int32 adtId, rootId, groupId; uint32 flags; if (getAreaInfo(mapId, x, y, data.floorZ, flags, adtId, rootId, groupId)) - data.areaInfo = boost::in_place(adtId, rootId, groupId, flags); + data.areaInfo.emplace(adtId, rootId, groupId, flags); return; } InstanceTreeMap::const_iterator instanceTree = GetMapTree(mapId); @@ -304,10 +304,10 @@ namespace VMAP float liquidLevel; if (!reqLiquidType || (GetLiquidFlagsPtr(liquidType) & reqLiquidType)) if (info.hitInstance->GetLiquidLevel(pos, info, liquidLevel)) - data.liquidInfo = boost::in_place(liquidType, liquidLevel); + data.liquidInfo.emplace(liquidType, liquidLevel); if (!IsVMAPDisabledForPtr(mapId, VMAP_DISABLE_AREAFLAG)) - data.areaInfo = boost::in_place(info.hitInstance->adtId, info.rootId, info.hitModel->GetWmoID(), info.hitModel->GetMogpFlags()); + data.areaInfo.emplace(info.hitInstance->adtId, info.rootId, info.hitModel->GetWmoID(), info.hitModel->GetMogpFlags()); } } } diff --git a/src/common/Utilities/Optional.h b/src/common/Utilities/Optional.h index dc5cd970970..55b9675fc59 100644 --- a/src/common/Utilities/Optional.h +++ b/src/common/Utilities/Optional.h @@ -18,8 +18,10 @@ #ifndef TrinityCore_Optional_h__ #define TrinityCore_Optional_h__ -#include "OptionalFwd.h" -#include <boost/optional.hpp> -#include <boost/utility/in_place_factory.hpp> +#include <optional> + +//! Optional helper class to wrap optional values within. +template <class T> +using Optional = std::optional<T>; #endif // TrinityCore_Optional_h__ diff --git a/src/common/Utilities/OptionalFwd.h b/src/common/Utilities/OptionalFwd.h deleted file mode 100644 index 516ebeb772e..00000000000 --- a/src/common/Utilities/OptionalFwd.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef OptionalFwd_h__ -#define OptionalFwd_h__ - -namespace boost -{ - template <class T> - class optional; -} - -//! Optional helper class to wrap optional values within. -template <class T> -using Optional = boost::optional<T>; - -#endif // OptionalFwd_h__ diff --git a/src/common/Utilities/TaskScheduler.cpp b/src/common/Utilities/TaskScheduler.cpp index 8b04a060cf3..4874885eed6 100644 --- a/src/common/Utilities/TaskScheduler.cpp +++ b/src/common/Utilities/TaskScheduler.cpp @@ -188,7 +188,7 @@ TaskContext& TaskContext::SetGroup(TaskScheduler::group_t const group) TaskContext& TaskContext::ClearGroup() { - _task->_group = boost::none; + _task->_group = std::nullopt; return *this; } diff --git a/src/common/Utilities/TaskScheduler.h b/src/common/Utilities/TaskScheduler.h index 9d5eabd94e2..da80d02be88 100644 --- a/src/common/Utilities/TaskScheduler.h +++ b/src/common/Utilities/TaskScheduler.h @@ -23,6 +23,7 @@ #include "Random.h" #include <algorithm> #include <chrono> +#include <functional> #include <vector> #include <queue> #include <memory> @@ -83,7 +84,7 @@ class TC_COMMON_API TaskScheduler // Minimal Argument construct Task(timepoint_t const& end, duration_t const& duration, task_handler_t const& task) - : _end(end), _duration(duration), _group(boost::none), _repeated(0), _task(task) { } + : _end(end), _duration(duration), _group(std::nullopt), _repeated(0), _task(task) { } // Copy construct Task(Task const&) = delete; |