@Test public void testAddToX() { pos.addToX(7); assertEquals(X_POSITION + 7, pos.getX()); pos.addToX(-6); assertEquals(X_POSITION + 1, pos.getX()); }
public void addToX(int positions) { x += positions; }
Position { public void addToX(int positions) { x += positions; } }
Position { public void addToX(int positions) { x += positions; } Position(byte x, byte y, int map); }
Position { public void addToX(int positions) { x += 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 addToX(int positions) { x += 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);  }