瀏覽代碼

Remove unused constructor

Ivan Savenko 2 年之前
父節點
當前提交
cac37df334
共有 2 個文件被更改,包括 2 次插入16 次删除
  1. 0 13
      lib/ResourceSet.cpp
  2. 2 3
      lib/ResourceSet.h

+ 0 - 13
lib/ResourceSet.cpp

@@ -25,19 +25,6 @@ ResourceSet::ResourceSet(const JsonNode & node)
 		container[i] = static_cast<int>(node[GameConstants::RESOURCE_NAMES[i]].Float());
 		container[i] = static_cast<int>(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)
 void ResourceSet::serializeJson(JsonSerializeFormat & handler, const std::string & fieldName)
 {
 {
 	if(handler.saving && !nonZero())
 	if(handler.saving && !nonZero())

+ 2 - 3
lib/ResourceSet.h

@@ -26,12 +26,11 @@ class ResourceSet;
 class ResourceSet
 class ResourceSet
 {
 {
 private:
 private:
-	std::array<TResource, GameConstants::RESOURCE_QUANTITY> container;
+	std::array<TResource, GameConstants::RESOURCE_QUANTITY> container = {};
 public:
 public:
 	// read resources set from json. Format example: { "gold": 500, "wood":5 }
 	// read resources set from json. Format example: { "gold": 500, "wood":5 }
 	DLL_LINKAGE ResourceSet(const JsonNode & node);
 	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)									\
 #define scalarOperator(OPSIGN)									\