1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
class Card
{
public:
std::string Name;
std::string FlipSideName;
std::string Rarity;
std::string Color;
std::string Type;
std::string Set;
std::string Link;
int Id;
float LowPrice, HighPrice, AveragePrice;
int CMC;
int Power;
int Toughness;
int NumOf;
int HasFlipSide;
Card(std::string name, std::string rarity, std::string color, std::string type, std::string set,
int cmc, int p, int t, int num, int flip, std::string flip_name): Id(0), LowPrice(0.0), HighPrice(0.0),
AveragePrice(0.0), NumOf(0), HasFlipSide(NO_FLIP_SIDE)
{
Name = name;
Rarity = rarity;
Color = color;
Type = type;
Set = set;
CMC = cmc;
Power = p;
Toughness = t;
NumOf = num;
HasFlipSide = flip;
FlipSideName = flip_name;
}
Card(std::string name, std::string rarity, std::string color, std::string type, std::string set,
int cmc, int p, int t, int num): Id(0), LowPrice(0.0), HighPrice(0.0),
AveragePrice(0.0),
NumOf(0), HasFlipSide(NO_FLIP_SIDE)
{
Name = name;
Rarity = rarity;
Color = color;
Type = type;
Set = set;
CMC = cmc;
Power = p;
Toughness = t;
NumOf = num;
}
Card& operator= (const Card& NewCard) //assignment
{
Name = NewCard.Name;
Rarity = NewCard.Rarity;
Color = NewCard.Color;
Type = NewCard.Type;
Set = NewCard.Set;
CMC = NewCard.CMC;
Power = NewCard.Power;
Toughness = NewCard.Toughness;
NumOf = NewCard.NumOf;
HasFlipSide = NewCard.HasFlipSide;
FlipSideName = NewCard.FlipSideName;
return *this;
}
Card (const Card& NewCard) //copy constructor
{
*this = NewCard;
}
Card(){}
~Card(){} //crashes on this line
};
| |