lines-grid-editor/line.cpp

38 lines
547 B
C++

#include "line.h"
Line::Line() {}
void Line::setStartPoint(QPoint newPoint)
{
start = newPoint;
}
void Line::setEndPoint(QPoint newPoint)
{
end = newPoint;
}
void Line::setColor(QString newColor)
{
color = newColor;
}
const QPoint &Line::getStart() const
{
return start;
}
const QPoint &Line::getEnd() const
{
return end;
}
QString Line::getColor()
{
return color;
}
QString Line::toLuaTable()
{
return QString("{ %1, %2, %3, %4, \"%5\" }").arg(start.x()).arg(start.y()).arg(end.x()).arg(end.y()).arg(color);
}