Style formatting - no code changes here.

This commit is contained in:
wrenczes@gmail.com
2011-04-20 09:38:40 +00:00
parent 6fb5766a5e
commit 02fbecfb85
2 changed files with 73 additions and 68 deletions

View File

@@ -10,84 +10,85 @@
using namespace std; using namespace std;
class CardPrimitive { class CardPrimitive
protected: {
vector<string> ftdText; protected:
string lcname; vector<string> ftdText;
ManaCost manaCost; string lcname;
ManaCost manaCost;
public: public:
ManaCost reducedCost; ManaCost reducedCost;
ManaCost increasedCost; ManaCost increasedCost;
string text; string text;
string name; string name;
int init(); int init();
int colors[Constants::MTG_NB_COLORS]; int colors[Constants::MTG_NB_COLORS];
map<int,int> basicAbilities; map<int,int> basicAbilities;
map<string,string> magicTexts; map<string,string> magicTexts;
string magicText; string magicText;
int alias; int alias;
string spellTargetType; string spellTargetType;
int power; int power;
int toughness; int toughness;
bool hasRestriction; bool hasRestriction;
string restriction; string restriction;
string otherrestriction; string otherrestriction;
int suspendedTime; int suspendedTime;
vector<int>types; vector<int>types;
CardPrimitive(); CardPrimitive();
CardPrimitive(CardPrimitive * source); CardPrimitive(CardPrimitive * source);
void setColor(int _color, int removeAllOthers = 0); void setColor(int _color, int removeAllOthers = 0);
void setColor(string _color, int removeAllOthers = 0); void setColor(string _color, int removeAllOthers = 0);
void removeColor(int color); void removeColor(int color);
int getColor(); int getColor();
int hasColor(int _color); int hasColor(int _color);
int countColors(); int countColors();
int has(int ability); int has(int ability);
void setText(const string& value); void setText(const string& value);
const char * getText(); const char * getText();
void addMagicText(string value); void addMagicText(string value);
void addMagicText(string value, string zone); void addMagicText(string value, string zone);
void setName(const string& value); void setName(const string& value);
const string& getName() const; const string& getName() const;
const string& getLCName() const; const string& getLCName() const;
void addType(char * type_text); void addType(char * type_text);
void addType(int id); void addType(int id);
void setType(const string& type_text); void setType(const string& type_text);
void setSubtype(const string& value); void setSubtype(const string& value);
int removeType(string value, int removeAll = 0); int removeType(string value, int removeAll = 0);
int removeType(int value, int removeAll = 0); int removeType(int value, int removeAll = 0);
bool hasSubtype(int _subtype); bool hasSubtype(int _subtype);
bool hasSubtype(const char * _subtype); bool hasSubtype(const char * _subtype);
bool hasSubtype(string _subtype); bool hasSubtype(string _subtype);
bool hasType(int _type); bool hasType(int _type);
bool hasType(const char * type); bool hasType(const char * type);
void setManaCost(string value); void setManaCost(string value);
ManaCost * getManaCost(); ManaCost * getManaCost();
ManaCost * getReducedManaCost(); ManaCost * getReducedManaCost();
ManaCost * getIncreasedManaCost(); ManaCost * getIncreasedManaCost();
bool isCreature(); bool isCreature();
bool isLand(); bool isLand();
bool isSpell(); bool isSpell();
void setPower(int _power); void setPower(int _power);
int getPower(); int getPower();
void setToughness(int _toughness); void setToughness(int _toughness);
int getToughness(); int getToughness();
void setRestrictions(string _restriction); void setRestrictions(string _restriction);
void getRestrictions(); void getRestrictions();
void setOtherRestrictions(string _restriction); void setOtherRestrictions(string _restriction);
void getOtherRestrictions(); void getOtherRestrictions();
const vector<string>& formattedText(); const vector<string>& formattedText();
}; };

View File

@@ -26,7 +26,7 @@ CardPrimitive::CardPrimitive(CardPrimitive * source)
reducedCost.copy(source->getReducedManaCost()); reducedCost.copy(source->getReducedManaCost());
increasedCost.copy(source->getIncreasedManaCost()); increasedCost.copy(source->getIncreasedManaCost());
if(source->getManaCost()->alternative) if(source->getManaCost()->alternative)
manaCost.alternative->alternativeName = source->getManaCost()->alternative->alternativeName; manaCost.alternative->alternativeName = source->getManaCost()->alternative->alternativeName;
text = source->text; text = source->text;
setName(source->name); setName(source->name);
@@ -82,10 +82,12 @@ bool CardPrimitive::isCreature()
{ {
return hasSubtype(Subtypes::TYPE_CREATURE); return hasSubtype(Subtypes::TYPE_CREATURE);
} }
bool CardPrimitive::isLand() bool CardPrimitive::isLand()
{ {
return hasSubtype(Subtypes::TYPE_LAND); return hasSubtype(Subtypes::TYPE_LAND);
} }
bool CardPrimitive::isSpell() bool CardPrimitive::isSpell()
{ {
return (!isCreature() && !isLand()); return (!isCreature() && !isLand());
@@ -95,6 +97,7 @@ void CardPrimitive::setRestrictions(string _restriction)
{ {
restriction = _restriction; restriction = _restriction;
} }
void CardPrimitive::getRestrictions() void CardPrimitive::getRestrictions()
{ {
restriction; restriction;
@@ -104,6 +107,7 @@ void CardPrimitive::setOtherRestrictions(string _restriction)
{ {
otherrestriction = _restriction; otherrestriction = _restriction;
} }
void CardPrimitive::getOtherRestrictions() void CardPrimitive::getOtherRestrictions()
{ {
otherrestriction; otherrestriction;