2017-03-09 16:08:47 +01:00
|
|
|
package mrbesen.cr.auto.clicker;
|
|
|
|
|
2017-04-07 09:21:52 +02:00
|
|
|
import java.util.Random;
|
|
|
|
|
2017-03-09 16:08:47 +01:00
|
|
|
public class Point {
|
|
|
|
|
|
|
|
int x = 0, y = 0;
|
|
|
|
|
|
|
|
public String serialize() {
|
|
|
|
return (x +"x"+y);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Point(String deserialize) {
|
|
|
|
String[] split = deserialize.split("x",2);
|
|
|
|
x = Integer.parseInt(split[0]);
|
|
|
|
y = Integer.parseInt(split[1]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Point(int x, int y) {
|
|
|
|
this.x = x; this.y = y;
|
|
|
|
}
|
2017-03-11 16:41:11 +01:00
|
|
|
|
|
|
|
public Point add(int x, int y) {
|
|
|
|
return new Point(this.x+x, this.y+y);
|
|
|
|
}
|
2017-04-07 09:21:52 +02:00
|
|
|
|
|
|
|
public Point(int random) {
|
|
|
|
Random rand = new Random();
|
|
|
|
x = rand.nextInt(random) - (random/2);
|
|
|
|
y = rand.nextInt(random) - (random/2);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Point add(Point a) {
|
|
|
|
return new Point(a.x+x, a.y+y);
|
|
|
|
}
|
2017-03-09 16:08:47 +01:00
|
|
|
}
|