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:
parent
029b77e7c4
commit
11b50ca176
@ -1,2 +0,0 @@
|
|||||||
8
|
|
||||||
250 500 250 500 500 500 1 0
|
|
4
config/ressources.json
Normal file
4
config/ressources.json
Normal 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 ]
|
||||||
|
}
|
@ -196,18 +196,12 @@ void CObjectHandler::loadObjects()
|
|||||||
}
|
}
|
||||||
tlog5 << "\t\tDone loading cregens!\n";
|
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;
|
resVals.push_back(price.Float());
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
tlog5 << "\t\tDone loading resource prices!\n";
|
tlog5 << "\t\tDone loading resource prices!\n";
|
||||||
}
|
|
||||||
|
|
||||||
std::ifstream istr;
|
std::ifstream istr;
|
||||||
istr.open(DATA_DIR "/config/bankconfig.txt", std::ios_base::binary);
|
istr.open(DATA_DIR "/config/bankconfig.txt", std::ios_base::binary);
|
||||||
|
Loading…
Reference in New Issue
Block a user