Files
wagic/projects/mtg/include/ManaCostHybrid.h
wrenczes@gmail.com ba0f5c4191 Reduced ManaCostHybrid's internals to uint8_t instead of ints. Removed the hardsized array of ManaCostHybrid pointers, and replaced it with a vector of objects, got rid of all the unnecessary new/delete code everywhere.
Also deleted "extraCostsIsCopy" from ManaCost - unused variable.

Overall, drops ManaCost from 148 bytes to 120 (which in turn reduces CardPrimitive's memory footprint by the same amount, since it encapsulates a ManaCost).
2011-04-28 07:49:51 +00:00

28 lines
654 B
C++

#ifndef _MANACOST_HYBRID_H_
#define _MANACOST_HYBRID_H_
class ManaCostHybrid
{
public:
uint8_t color1;
uint8_t color2;
uint8_t value1;
uint8_t value2;
ManaCostHybrid();
ManaCostHybrid(const ManaCostHybrid& hybridManaCost);
ManaCostHybrid(const ManaCostHybrid* hybridManaCost);
ManaCostHybrid(int c1, int v1, int c2, int v2);
void init(int c1, int v1, int c2, int v2);
int hasColor(int color);
string toString();
int getConvertedCost();
friend std::ostream& operator<<(std::ostream& out, ManaCostHybrid& m);
friend std::ostream& operator<<(std::ostream& out, ManaCostHybrid* m);
};
#endif