forked from plastictown/Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathline-object.cpp
More file actions
73 lines (60 loc) · 1.42 KB
/
Copy pathline-object.cpp
File metadata and controls
73 lines (60 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <line-object.h>
#include <render.h>
LineObject::LineObject() : Drawable(), a{}, b{}, color{} {
setType("line2f");
}
LineObject::LineObject(const Point2f& p1, const Point2f& p2, const Color4& c)
: Drawable(), a(p1), b(p2), color(c) {
setType("line2f");
}
LineObject::LineObject(const LineObject& rhs) : Drawable() {
if (this == &rhs)
return;
setType("line2f");
a = rhs.a;
b = rhs.b;
color = rhs.color;
}
LineObject::~LineObject() {}
LineObject& LineObject::operator=(const LineObject& rhs) {
if (this == &rhs)
return *this;
setType(rhs.type);
a = rhs.a;
b = rhs.b;
color = rhs.color;
return *this;
}
LineObject& LineObject::operator=(LineObject&& rhs) {
type = std::move(rhs.type);
a = rhs.a;
b = rhs.b;
color = rhs.color;
return *this;
}
bool LineObject::operator==(const LineObject& rhs) const noexcept {
if (this == &rhs)
return true;
return (a == rhs.a) && (b == rhs.b) && (color == rhs.color);
}
const Point2f& LineObject::getA() const noexcept {
return a;
}
void LineObject::setA(const Point2f& value) noexcept {
a = value;
}
const Point2f& LineObject::getB() const noexcept {
return b;
}
void LineObject::setB(const Point2f& value) noexcept {
b = value;
}
const Color4& LineObject::getColor() const noexcept {
return color;
}
void LineObject::setColor(const Color4& value) noexcept {
color = value;
}
void LineObject::draw() {
Render::DrawObject(*this);
}