From cac37df334f44ac903fafc1ac5bf16d5e8d8c050 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 2 Nov 2023 19:57:00 +0200 Subject: [PATCH] Remove unused constructor --- lib/ResourceSet.cpp | 13 ------------- lib/ResourceSet.h | 5 ++--- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/ResourceSet.cpp b/lib/ResourceSet.cpp index e9fa85243..ab786c7fd 100644 --- a/lib/ResourceSet.cpp +++ b/lib/ResourceSet.cpp @@ -25,19 +25,6 @@ ResourceSet::ResourceSet(const JsonNode & node) container[i] = static_cast(node[GameConstants::RESOURCE_NAMES[i]].Float()); } -ResourceSet::ResourceSet(TResource wood, TResource mercury, TResource ore, TResource sulfur, TResource crystal, - TResource gems, TResource gold, TResource mithril) -{ - container[GameResID(EGameResID::WOOD)] = wood; - container[GameResID(EGameResID::MERCURY)] = mercury; - container[GameResID(EGameResID::ORE)] = ore; - container[GameResID(EGameResID::SULFUR)] = sulfur; - container[GameResID(EGameResID::CRYSTAL)] = crystal; - container[GameResID(EGameResID::GEMS)] = gems; - container[GameResID(EGameResID::GOLD)] = gold; - container[GameResID(EGameResID::MITHRIL)] = mithril; -} - void ResourceSet::serializeJson(JsonSerializeFormat & handler, const std::string & fieldName) { if(handler.saving && !nonZero()) diff --git a/lib/ResourceSet.h b/lib/ResourceSet.h index 676ee3730..ad844b230 100644 --- a/lib/ResourceSet.h +++ b/lib/ResourceSet.h @@ -26,12 +26,11 @@ class ResourceSet; class ResourceSet { private: - std::array container; + std::array container = {}; public: // read resources set from json. Format example: { "gold": 500, "wood":5 } DLL_LINKAGE ResourceSet(const JsonNode & node); - DLL_LINKAGE ResourceSet(TResource wood = 0, TResource mercury = 0, TResource ore = 0, TResource sulfur = 0, TResource crystal = 0, - TResource gems = 0, TResource gold = 0, TResource mithril = 0); + DLL_LINKAGE ResourceSet() = default; #define scalarOperator(OPSIGN) \