1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00
Files
vcmi/lib/mapObjects/CObjectHandler.cpp

34 lines
840 B
C++
Raw Normal View History

/*
2014-06-05 19:57:43 +03:00
* CObjectHandler.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "CObjectHandler.h"
#include "CGObjectInstance.h"
2025-09-14 14:36:02 +02:00
#include "../GameLibrary.h"
#include "../entities/ResourceTypeHandler.h"
#include "../filesystem/ResourcePath.h"
#include "../json/JsonNode.h"
VCMI_LIB_NAMESPACE_BEGIN
2014-06-05 19:57:43 +03:00
CObjectHandler::CObjectHandler()
{
2017-08-10 19:39:27 +03:00
logGlobal->trace("\t\tReading resources prices ");
2025-09-14 14:36:02 +02:00
for(auto & res : LIBRARY->resourceTypeHandler->getAllObjects())
2014-06-05 19:57:43 +03:00
{
2025-09-14 14:36:02 +02:00
auto resType = LIBRARY->resourceTypeHandler->getById(res);
resVals[res] = static_cast<ui32>(resType->getPrice());
2014-06-05 19:57:43 +03:00
}
2017-08-10 19:39:27 +03:00
logGlobal->trace("\t\tDone loading resource prices!");
2014-06-05 19:57:43 +03:00
}
VCMI_LIB_NAMESPACE_END