@Test public void testAddToY() { pos.addToY(7); assertEquals(Y_POSITION + 7, pos.getY()); pos.addToY(-6); assertEquals(Y_POSITION + 1, pos.getY()); }
public void addToY(int positions) { y += positions; }
Position { public void addToY(int positions) { y += positions; } }
Position { public void addToY(int positions) { y += positions; } Position(byte x, byte y, int map); }
Position { public void addToY(int positions) { y += positions; } Position(byte x, byte y, int map); byte getX(); void setX(byte x); byte getY(); void setY(byte y); int getMap(); void setMap(int map); void addToX(int positions); void addToY(int positions); int getDistance(Position pos); boolean inVisionRange(Position pos); @Override int hashCode(); @Override boolean equals(Object obj); }
Position { public void addToY(int positions) { y += positions; } Position(byte x, byte y, int map); byte getX(); void setX(byte x); byte getY(); void setY(byte y); int getMap(); void setMap(int map); void addToX(int positions); void addToY(int positions); int getDistance(Position pos); boolean inVisionRange(Position pos); @Override int hashCode(); @Override boolean equals(Object obj);  }