Commit 4363a18f authored by Ilya Prokhorov's avatar Ilya Prokhorov

Fixed by aStyle

parent 0769ae21
......@@ -14,24 +14,24 @@ Color::Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t 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;
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;
};
string Color::asString() {
string output = "";
output += "red: ";
output += to_string(red);
output += " green: ";
output += to_string(green);
output += " blue: ";
output += to_string(blue);
output += " alpha: ";
output += to_string(alpha);
return output;
string output = "";
output += "red: ";
output += to_string(red);
output += " green: ";
output += to_string(green);
output += " blue: ";
output += to_string(blue);
output += " alpha: ";
output += to_string(alpha);
return output;
};
\ No newline at end of file
......@@ -19,8 +19,8 @@ public:
uint8_t blue;
uint8_t alpha;
bool isEqualTo(shared_ptr<Color> color);
string asString();
bool isEqualTo(shared_ptr<Color> color);
string asString();
};
};
......
......@@ -16,11 +16,11 @@ Image::Image(int width, int height) {
void Image::setColorAtXY(shared_ptr<Color> color, int x, int y) {
if (x < 0 || y < 0 || x >= width || y >= height) {
string errorString = string("Can't set color outside of image size");
errorString += to_string(x);
errorString += " ";
errorString += to_string(y);
throwRuntimeException(errorString);
string errorString = string("Can't set color outside of image size");
errorString += to_string(x);
errorString += " ";
errorString += to_string(y);
throwRuntimeException(errorString);
}
int index = (y * width) + x;
......@@ -30,7 +30,7 @@ void Image::setColorAtXY(shared_ptr<Color> color, int x, int y) {
shared_ptr<Color> Image::getColorAtXY(int x, int y) {
if (x < 0 || y < 0 || x >= width || y >= height) {
throwRuntimeException("Can't get color outside of image size");
throwRuntimeException("Can't get color outside of image size");
}
int index = (y * width) + x;
......
......@@ -6,21 +6,21 @@ using namespace FlameSteelCore::Utils;
using namespace FlameSteelCommonTraits;
inline bool isRDNS(string path) {
for (unsigned i=0; i<path.length(); ++i)
{
auto character = path.at(i);
if (isalpha(character) == false && character != '.') {
return false;
}
}
return true;
for (unsigned i=0; i<path.length(); ++i)
{
auto character = path.at(i);
if (isalpha(character) == false && character != '.') {
return false;
}
}
return true;
};
Path::Path(string path) {
if (isRDNS(path) == false) {
string errorText = path;
errorText += "is not in reverse-domain-format";
throwRuntimeException(errorText);
}
this->path = path;
if (isRDNS(path) == false) {
string errorText = path;
errorText += "is not in reverse-domain-format";
throwRuntimeException(errorText);
}
this->path = path;
};
\ No newline at end of file
......@@ -10,8 +10,8 @@ namespace FlameSteelCommonTraits {
class Path {
public:
Path(string path);
string path;
Path(string path);
string path;
};
......
......@@ -11,10 +11,10 @@ FSEGTSerializedModel::FSEGTSerializedModel(shared_ptr<string> serializedModel) {
void FSEGTSerializedModel::append(shared_ptr<string> stringToAppend) {
if (stringToAppend.get() == nullptr) {
throwRuntimeException(string("Can't append empty string"));
}
if (stringToAppend.get() == nullptr) {
throwRuntimeException(string("Can't append empty string"));
}
*serializedModel += *stringToAppend;
*serializedModel += *stringToAppend;
};
\ No newline at end of file
......@@ -9,10 +9,10 @@ class FSEGTSerializedModel: public Object {
public:
FSEGTSerializedModel(shared_ptr<string> serializedModel);
void append(shared_ptr<string> stringToAppend);
void append(shared_ptr<string> stringToAppend);
shared_ptr<string> serializedModel;
int dotsCount = 0;
int dotsCount = 0;
};
......
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