Modifications to make the game more generic.

Included in a new modrules.xml tags.
 <cardgui>
   <background> Stores information concerning the colors </ background>
   <renderbig> Stores information to draw the card </ renderbig>
  <rendertinycrop> Stores information to draw the card </ rendertinycrop>
 </ cardgui>

 Change the variables array for vectors
This commit is contained in:
rodrigodemoura@gmail.com
2011-10-13 12:25:58 +00:00
parent dee49728aa
commit e6b199f599
30 changed files with 919 additions and 556 deletions

View File

@@ -308,8 +308,9 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
void MTGAllCards::initCounters()
{
for (int i = 0; i < Constants::MTG_NB_COLORS; i++)
colorsCount[i] = 0;
colorsCount.erase(colorsCount.begin(),colorsCount.end());
for (int i = 0; i < Constants::NB_Colors; i++)
colorsCount.push_back(0);
}
void MTGAllCards::init()
@@ -480,7 +481,7 @@ int MTGAllCards::countByColor(int color)
{
if (colorsCount[color] == 0)
{
for (int i = 0; i < Constants::MTG_NB_COLORS; i++)
for (int i = 0; i < Constants::NB_Colors; i++)
{
colorsCount[i] = 0;
}
@@ -811,8 +812,9 @@ int MTGDeck::addRandomCards(int howmany, int * setIds, int nbSets, int rarity, c
{
if (howmany <= 0) return 1;
int unallowedColors[Constants::MTG_NB_COLORS + 1];
for (int i = 0; i < Constants::MTG_NB_COLORS; ++i)
vector<int> unallowedColors;
unallowedColors.resize(Constants::NB_Colors + 1);
for (int i = 0; i < Constants::NB_Colors; ++i)
{
if (nbcolors)
unallowedColors[i] = 1;
@@ -854,7 +856,7 @@ int MTGDeck::addRandomCards(int howmany, int * setIds, int nbSets, int rarity, c
if (ok)
{
for (int j = 0; j < Constants::MTG_NB_COLORS; ++j)
for (int j = 0; j < Constants::NB_Colors; ++j)
{
if (unallowedColors[j] && card->data->hasColor(j))
{