38 lines
900 B
C++
38 lines
900 B
C++
#include "Color.h"
|
|
|
|
static const Color C_NOTHING = {255, 255, 255};
|
|
static const Color C_OUT_OF_BOUNDS = C_NOTHING;
|
|
static const Color C_GARBAGE = {150, 150, 150};
|
|
static const Color C_PURPLE = {150, 0, 255};
|
|
static const Color C_ORANGE = {255, 150, 0};
|
|
static const Color C_CYAN = {0, 255, 0};
|
|
static const Color C_PINK = {255, 0, 200};
|
|
static const Color C_YELLOW = {255, 255, 0};
|
|
static const Color C_RED = {255, 0, 0};
|
|
static const Color C_BLUE = {0, 100, 255};
|
|
static const Color C_GREEN = {0, 255, 0};
|
|
|
|
static const Color colors[] = {
|
|
C_NOTHING,
|
|
C_OUT_OF_BOUNDS,
|
|
C_GARBAGE,
|
|
C_PURPLE,
|
|
C_ORANGE,
|
|
C_CYAN,
|
|
C_PINK,
|
|
C_YELLOW,
|
|
C_RED,
|
|
C_BLUE,
|
|
C_GREEN
|
|
};
|
|
|
|
const Color& getColor(ColorEnum color) {
|
|
return colors[color];
|
|
}
|
|
|
|
void setNextPieceColor(ColorEnum& color) {
|
|
if (color == GREEN)
|
|
color = PURPLE;
|
|
else
|
|
color = ColorEnum(color + 1);
|
|
} |