parse "total" cards in set infor

This commit is contained in:
Anthony Calosa
2016-07-01 22:09:08 +08:00
parent 6ce67a95a2
commit 6dc69ded22
3 changed files with 8 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ public:
string name; //Long name: Tenth Edition
int block; //For future use by tournament mode, etc.
int year; //The year the set was released.
int total;//total cards
//TODO Way to group cards by name, rather than mtgid.
void count(MTGCard * c);

View File

@@ -108,6 +108,8 @@ void GameStateAwards::Start()
if (!si->author.size())
sprintf(buf, _("%i cards.").c_str(), si->totalCards());
else if (si->year > 0 && si->total > 0)
sprintf(buf, _("%s (%i): %i/%i cards").c_str(), si->author.c_str(), si->year, si->totalCards(), si->total);
else if (si->year > 0)
sprintf(buf, _("%s (%i): %i cards").c_str(), si->author.c_str(), si->year, si->totalCards());
else

View File

@@ -1383,6 +1383,7 @@ MTGSetInfo::MTGSetInfo(const string& _id)
id = _id;
block = -1;
year = -1;
total = -1;
for (int i = 0; i < MTGSetInfo::MAX_COUNT; i++)
counts[i] = 0;
@@ -1458,5 +1459,8 @@ void MTGSetInfo::processConfLine(string line)
author = value;
else if (key.compare("block") == 0)
block = setlist.findBlock(value.c_str());
else if (key.compare("year") == 0) year = atoi(value.c_str());
else if (key.compare("year") == 0)
year = atoi(value.c_str());
else if (key.compare("total") == 0)
total = atoi(value.c_str());
}