-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyPoint.cpp
53 lines (49 loc) · 885 Bytes
/
MyPoint.cpp
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
/*
** YARG MyLine.cpp
** Copyright Tom Troyer 2010 (tom.troyer@gmail.com)
** Released under GPLv3
**
** More leftover legacy code. It works, so it's still here for now.
*/
#include "MyPoint.h"
MyPoint::MyPoint (float n, float m){
x = n; m = y;
up = true; right = true;
minX = 0; minY = 0;
maxX = 800; maxY = 600;
}
MyPoint::MyPoint (){
x = 100; y=100;
up = true; right = true;
minX=0; minY = 0;
maxX = 800; maxY = 600;
}
MyPoint::~MyPoint (){
//std::cout << "\nmypoint destructed?";
}
float MyPoint::getX(){
return x;
}
float MyPoint::getY(){
return y;
}
void MyPoint::setX(float n){
x = n;
if(x>maxX)
right = false;
else if(x<0)
right = true;
}
void MyPoint::setY(float m){
y = m;
if(y>maxY)
up = false;
else if(y<0)
up = true;
}
bool MyPoint::getUp(){
return up;
}
bool MyPoint::getRight(){
return right;
}