Erwan
- Added AI Decks unlock system. Please update your graphics folder, and crossing fingers that Ilya B. is still around as I don't have the correct fonts.
This commit is contained in:
@@ -265,39 +265,39 @@ std::string wordWrap(std::string sentence, int width)
|
||||
// Given a delimited string of abilities, add the ones to the list that are "Basic" MTG abilities
|
||||
void PopulateAbilityIndexVector( list<int>& abilities, const string& abilityStringList, char delimiter )
|
||||
{
|
||||
vector<string> abilitiesList = split( abilityStringList, delimiter);
|
||||
for ( vector<string>::iterator iter = abilitiesList.begin(); iter != abilitiesList.end(); ++iter)
|
||||
{
|
||||
int abilityIndex = Constants::GetBasicAbilityIndex( *iter );
|
||||
|
||||
if (abilityIndex != -1)
|
||||
abilities.push_back( abilityIndex );
|
||||
vector<string> abilitiesList = split( abilityStringList, delimiter);
|
||||
for ( vector<string>::iterator iter = abilitiesList.begin(); iter != abilitiesList.end(); ++iter)
|
||||
{
|
||||
int abilityIndex = Constants::GetBasicAbilityIndex( *iter );
|
||||
|
||||
if (abilityIndex != -1)
|
||||
abilities.push_back( abilityIndex );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PopulateColorIndexVector( list<int>& colors, const string& colorStringList, char delimiter )
|
||||
{
|
||||
vector<string> abilitiesList = split( colorStringList, delimiter);
|
||||
for ( vector<string>::iterator iter = abilitiesList.begin(); iter != abilitiesList.end(); ++iter)
|
||||
{
|
||||
for (int colorIndex = Constants::MTG_COLOR_ARTIFACT; colorIndex < Constants::MTG_NB_COLORS; ++colorIndex)
|
||||
{
|
||||
// if the text is not a basic ability but contains a valid color add it to the color vector
|
||||
if ( (Constants::GetBasicAbilityIndex( *iter ) != -1) && ((*iter).find( Constants::MTGColorStrings[ colorIndex ] ) != string::npos) )
|
||||
colors.push_back(colorIndex);
|
||||
}
|
||||
vector<string> abilitiesList = split( colorStringList, delimiter);
|
||||
for ( vector<string>::iterator iter = abilitiesList.begin(); iter != abilitiesList.end(); ++iter)
|
||||
{
|
||||
for (int colorIndex = Constants::MTG_COLOR_ARTIFACT; colorIndex < Constants::MTG_NB_COLORS; ++colorIndex)
|
||||
{
|
||||
// if the text is not a basic ability but contains a valid color add it to the color vector
|
||||
if ( (Constants::GetBasicAbilityIndex( *iter ) != -1) && ((*iter).find( Constants::MTGColorStrings[ colorIndex ] ) != string::npos) )
|
||||
colors.push_back(colorIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PopulateSubtypesIndexVector( list<int>& types, const string& subTypesStringList, char delimiter)
|
||||
{
|
||||
vector<string> subTypesList = split( subTypesStringList, delimiter);
|
||||
for (vector<string>::iterator it = subTypesList.begin(); it != subTypesList.end(); ++it)
|
||||
{
|
||||
string subtype = *it;
|
||||
size_t id = Subtypes::subtypesList->find( subtype );
|
||||
if ( id != string::npos )
|
||||
types.push_back(id);
|
||||
vector<string> subTypesList = split( subTypesStringList, delimiter);
|
||||
for (vector<string>::iterator it = subTypesList.begin(); it != subTypesList.end(); ++it)
|
||||
{
|
||||
string subtype = *it;
|
||||
size_t id = Subtypes::subtypesList->find( subtype );
|
||||
if ( id != string::npos )
|
||||
types.push_back(id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user