1 package org.catacomb.interlish.content; 2 3 4 public final class IntPosition { 5 6 int x; 7 int y; 8 9 10 public IntPosition() { 11 this(0, 0); 12 } 13 14 public IntPosition(IntPosition p) { 15 this(p.getX(), p.getY()); 16 } 17 18 19 public IntPosition(int px, int py) { 20 set(px, py); 21 } 22 23 24 public void set(IntPosition p) { 25 set(p.getX(), p.getY()); 26 } 27 28 29 public void set(int px, int py) { 30 x = px; 31 y = py; 32 } 33 34 public void shift(int dx, int dy) { 35 x += dx; 36 y += dy; 37 } 38 39 40 public int getX() { 41 return x; 42 } 43 44 45 public int getY() { 46 return y; 47 } 48 49 public void subtract(IntPosition sm) { 50 x -= sm.getX(); 51 y -= sm.getY(); 52 53 } 54 55 56 }