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

Created ressources.json from resources.txt.

This commit is contained in:
Frank Zago 2011-09-03 14:26:39 +00:00
parent 029b77e7c4
commit 11b50ca176
3 changed files with 8 additions and 12 deletions

View File

@ -1,2 +0,0 @@
8
250 500 250 500 500 500 1 0

4
config/ressources.json Normal file
View File

@ -0,0 +1,4 @@
{
// Price of each ressource in gold, in usual ressource order
"ressources_prices": [ 250, 500, 250, 500, 500, 500, 1, 0 ]
}

View File

@ -196,18 +196,12 @@ void CObjectHandler::loadObjects()
}
tlog5 << "\t\tDone loading cregens!\n";
const JsonNode config2(DATA_DIR "/config/ressources.json");
BOOST_FOREACH(const JsonNode &price, config2["ressources_prices"].Vector())
{
int k = -1;
std::ifstream ifs(DATA_DIR "/config/resources.txt");
ifs >> k;
int pom;
for(int i=0;i<k;i++)
{
ifs >> pom;
resVals.push_back(pom);
resVals.push_back(price.Float());
}
tlog5 << "\t\tDone loading resource prices!\n";
}
std::ifstream istr;
istr.open(DATA_DIR "/config/bankconfig.txt", std::ios_base::binary);