Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean contains(int x, int y) {
- boolean xIn = (this.x < x) && (x < this.x + width);
- boolean yIn = (this.y < y) && (y < this.y + height);
- return xIn && yIn;
- }
- public boolean contains(Point p) {
- boolean xIn = (this.x < p.getX()) && (p.getX() < this.x + width);
- boolean yIn = (this.y < p.getY()) && (p.getY() < this.y + height);
- return xIn && yIn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement