#include #include #include #include "BalloonT.h" using namespace std; ostream & operator << (ostream & s, ColorT b){ s << ColorTToString(b); return s; } std::string ColorTToString(ColorT b){ switch (b){ case ColorT::RED: return "Red"; case ColorT::GREEN: return "Green"; case ColorT::BLUE: return "Blue"; case ColorT::YELLOW: return "Yellow"; case ColorT::CYAN: return "Cyan"; case ColorT::MAGENTA: return "Magenta"; case ColorT::NO_COLOR: default: return "NO_COLOR"; } } ColorT IntToColorT(int i) { i %= COLOR_COUNT; return static_cast(i); } ColorT operator ++(ColorT & c, int){ ColorT rv = ColorT::NO_COLOR; if (c < ColorT::NO_COLOR) { rv = c = static_cast(static_cast(c) + 1); } return rv; } BalloonT::BalloonT(ColorT c){ color = c; value = 0; } BalloonT::BalloonT(ColorT c, int i){ color = c; value = i; } ColorT BalloonT::Color(void) const{ return color; } int BalloonT::Value(void) const{ return value; } void BalloonT::Value(int i){ value = i; } void BalloonT::Pop(void) { value =0; }