Coord.java 441 B

12345678910111213141516171819202122232425262728293031
  1. package pathgame.algorithm;
  2. public class Coord {
  3. private int x, y;
  4. Coord(int x, int y) {
  5. this.x = x;
  6. this.y = y;
  7. }
  8. int getX() {
  9. return x;
  10. }
  11. int getY() {
  12. return y;
  13. }
  14. public void changeX(int x) {
  15. this.x += x;
  16. }
  17. public void changeY(int y) {
  18. this.y += y;
  19. }
  20. public void setCoord(int x, int y) {
  21. this.x = x;
  22. this.y = y;
  23. }
  24. }