1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Remove unused constructor

This commit is contained in:
Ivan Savenko 2023-11-02 19:57:00 +02:00
parent 184f5a72cc
commit cac37df334
2 changed files with 2 additions and 16 deletions

View File

@ -25,19 +25,6 @@ ResourceSet::ResourceSet(const JsonNode & node)
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)
{
if(handler.saving && !nonZero())

View File

@ -26,12 +26,11 @@ class ResourceSet;
class ResourceSet
{
private:
std::array<TResource, GameConstants::RESOURCE_QUANTITY> container;
std::array<TResource, GameConstants::RESOURCE_QUANTITY> 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) \