Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected boolean isValidPos(Vector pos) throws OutOfBoundsException {
- if (getWorld() == null) {
- if (pos.getElemx() >= 0 && pos.getElemy() >= 0){
- return true;
- } else{
- throw new OutOfBoundsException(new Vector(0,0));
- }
- }else if ((pos.getElemx() >= 0) && (pos.getElemy() >= 0)
- && pos.getElemx() < this.getWorld().getWorldSizeInPixels()[0]
- && pos.getElemy() < this.getWorld().getWorldSizeInPixels()[1]){
- return true;
- }else{
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement