Commit 47791bd7 authored by Ilya Prokhorov's avatar Ilya Prokhorov

Pre screenshot validator

parent 0f84c4b6
#include "Color.h"
#include <FlameSteelCore/FSCUtils.h>
using namespace FlameSteelCore::Utils;
using namespace FlameSteelEngine::CommonTraits;
Color::Color(int8_t red, int8_t green, int8_t blue, int8_t alpha) {
......@@ -10,3 +12,13 @@ Color::Color(int8_t red, int8_t green, int8_t blue, int8_t alpha) {
this->alpha = alpha;
};
bool Color::isEqualTo(shared_ptr<Color> color) {
if (color.get() == nullptr) {
throwRuntimeException(string("Can't check colors equality, rhs color is nullptr"));
}
if (red != color->red || green != color->green || blue != color->blue || alpha != color->alpha) {
return false;
}
return true;
};
\ No newline at end of file
......@@ -2,6 +2,9 @@
#define FLAMESTEELCOMMONTRAITSCOLOR_H_
#include <cstdint>
#include <memory>
using namespace std;
namespace FlameSteelEngine {
namespace CommonTraits {
......@@ -16,6 +19,8 @@ public:
uint8_t blue;
uint8_t alpha;
bool isEqualTo(shared_ptr<Color> color);
};
};
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment