-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyPoint.java
More file actions
62 lines (49 loc) · 910 Bytes
/
MyPoint.java
File metadata and controls
62 lines (49 loc) · 910 Bytes
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
package snake;
/**
*
* @author Jirka
*/
public class MyPoint {
private int x = 0;
private int y = 0;
public MyPoint(int x, int y){
this.x = x;
this.y = y;
}
public void setPoint(MyPoint p){
this.x = p.getX();
this.y = p.getY();
}
public void setPoint(int x, int y){
this.x = x;
this.y = y;
}
public int getX(){
return(x);
}
public int getY(){
return(y);
}
public void setX(int x){
this.x = x;
}
public void setY(int y){
this.y = y;
}
public void decX(){
x--;
}
public void decY(){
y--;
}
public void incX(){
x++;
}
public void incY(){
y++;
}
/*public void newPoint(int x, int y){
this.x = x;
this.y = y;
}*/
}