Added/fixed some primitives, improved Deck Editor to allow user to choose commanders from collection and add them to their decks. Implemented command color identity rule and single card instance limitation for Commander Format game mode.
This commit is contained in:
@@ -1190,6 +1190,16 @@ void MTGDeck::replaceSB(vector<string> newSB)
|
||||
return;
|
||||
}
|
||||
|
||||
void MTGDeck::replaceCMD(vector<string> newCMD)
|
||||
{
|
||||
if(newCMD.size())
|
||||
{
|
||||
CommandZone.clear();
|
||||
CommandZone = newCMD;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int MTGDeck::remove(int cardid)
|
||||
{
|
||||
if (cards.find(cardid) == cards.end() || cards[cardid] == 0) return 0;
|
||||
@@ -1270,6 +1280,17 @@ int MTGDeck::save(const string& destFileName, bool useExpandedDescriptions, cons
|
||||
file << "#SB:" << checkID << "\n";
|
||||
}
|
||||
}
|
||||
//save commanders
|
||||
if(CommandZone.size())
|
||||
{
|
||||
sort(CommandZone.begin(), CommandZone.end());
|
||||
for(unsigned int k = 0; k < CommandZone.size(); k++)
|
||||
{
|
||||
int checkID = atoi(CommandZone[k].c_str());
|
||||
if(checkID)
|
||||
file << "#CMD:" << checkID << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
JFileSystem::GetInstance()->Rename(tmp, destFileName);
|
||||
|
||||
Reference in New Issue
Block a user