-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMouse.cpp
72 lines (50 loc) · 982 Bytes
/
Mouse.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "Mouse.h"
void Mouse::onLeftButton(int x, int y) {
if (x > 400) { xx = -30; }
else { xx = 30; }
if (y > 400) { yy = -30; }
else { yy = 30; }
ynew =(yold - yy);
xnew =(xold - xx);
}
void Mouse::onRightButton(int x, int y) {
znew = zold + 45;
}
void Mouse::setXx(int xx) {
Mouse::xx = xx;
}
void Mouse::setXold(int xold) {
Mouse::xold = xold;
}
void Mouse::setYy(int yy) {
Mouse::yy = yy;
}
void Mouse::setYold(int yold) {
Mouse::yold = yold;
}
void Mouse::setZz() {
Mouse::zz = zz+20;
}
void Mouse::setZold(int zold) {
Mouse::zold = zold;
}
void Mouse::setState(State state)
{
Mouse::state = state;
}
/*void Mouse::setState(Mouse::State state) {
Mouse::state = state;
}*/
int Mouse::getXnew() const {
return xnew;
}
int Mouse::getYnew() const {
return ynew;
}
int Mouse::getZnew() const {
return znew;
}
Mouse::State Mouse::getState() const
{
return State();
}