-
Notifications
You must be signed in to change notification settings - Fork 0
/
Item.java
35 lines (24 loc) · 835 Bytes
/
Item.java
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
import java.io.*;
import java.awt.*;
public abstract class Item implements Serializable {
protected static UIContext uiContext;
protected boolean selection = false;
protected Point point;
public abstract boolean includes(Point point);
protected double distance(Point point1, Point point2) {
double xDifference = point1.getX() - point2.getX();
double yDifference = point1.getY() - point2.getY();
return ((double) (Math.sqrt(xDifference * xDifference + yDifference * yDifference)));
}
public abstract void translate(Point point);
protected void setSelection(boolean selection) {
this.selection = selection;
}
protected boolean selection() {
return selection;
}
public boolean containsPoint(int x, int y) {
return false;
}
public abstract void render(UIContext uiContext);
}