Coord.java 803 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package pathgame.algorithm;
  2. public class Coord {
  3. private int x, y;
  4. private boolean isBoatTile = false;
  5. public Coord(int x, int y) {
  6. this.x = x;
  7. this.y = y;
  8. }
  9. public Coord(int x, int y, boolean isBoatTile) {
  10. this.x = x;
  11. this.y = y;
  12. this.isBoatTile = isBoatTile;
  13. }
  14. public int getX() {
  15. return x;
  16. }
  17. public int getY() {
  18. return y;
  19. }
  20. public void changeX(int x) {
  21. this.x += x;
  22. }
  23. public void changeY(int y) {
  24. this.y += y;
  25. }
  26. public void setCoord(int x, int y) {
  27. this.x = x;
  28. this.y = y;
  29. }
  30. public boolean isBoatTile() {
  31. return isBoatTile;
  32. }
  33. public void setBoatTile(boolean isBoatTile) {
  34. this.isBoatTile = isBoatTile;
  35. }
  36. }