Adding a way to mark decks as "locked" based on options requirements (option on or off). Can be used for example to lock a deck until a specific set is not unlocked. Works for both player decks (could be used for premade?) and AI decks.
This commit is contained in:
@@ -30,6 +30,13 @@ void DeckMetaData::LoadDeck()
|
||||
mName = trim(deck.meta_name);
|
||||
mDescription = trim(deck.meta_desc);
|
||||
mDeckId = atoi((mFilename.substr(mFilename.find("deck") + 4, mFilename.find(".txt"))).c_str());
|
||||
|
||||
vector<string> requirements = split(deck.meta_unlockRequirements, ',');
|
||||
for(size_t i = 0; i < requirements.size(); ++i)
|
||||
{
|
||||
mUnlockRequirements.push_back(Options::getID(requirements[i]));
|
||||
}
|
||||
|
||||
mDeckLoaded = true;
|
||||
if (!mIsAI)
|
||||
mAvatarFilename = "avatar.jpg";
|
||||
@@ -115,6 +122,12 @@ int DeckMetaData::getDeckId()
|
||||
return mDeckId;
|
||||
}
|
||||
|
||||
vector<int> DeckMetaData::getUnlockRequirements()
|
||||
{
|
||||
return mUnlockRequirements;
|
||||
}
|
||||
|
||||
|
||||
string DeckMetaData::getAvatarFilename()
|
||||
{
|
||||
return mAvatarFilename;
|
||||
|
||||
Reference in New Issue
Block a user