@Test public void testAddSelectedTile() { int horizontalPosition = 5; int verticalPosition = 7; addSelectedTileAt(horizontalPosition, verticalPosition); Assert.assertEquals(mapSelection.getSelectedPositions().size(), 1); Assert.assertEquals(mapSelection.getOffsetX(), horizontalPosition); Assert.assertEquals(mapSelection.getOffsetY(), verticalPosition); }
public void addSelectedTile(@Nonnull MapPosition mapPosition, MapTile tile) { if (!selectedTiles.containsKey(mapPosition)) { adjustOffsets(mapPosition); selectedTiles.put(mapPosition, tile); } }
MapSelection { public void addSelectedTile(@Nonnull MapPosition mapPosition, MapTile tile) { if (!selectedTiles.containsKey(mapPosition)) { adjustOffsets(mapPosition); selectedTiles.put(mapPosition, tile); } } }
MapSelection { public void addSelectedTile(@Nonnull MapPosition mapPosition, MapTile tile) { if (!selectedTiles.containsKey(mapPosition)) { adjustOffsets(mapPosition); selectedTiles.put(mapPosition, tile); } } MapSelection(); }
MapSelection { public void addSelectedTile(@Nonnull MapPosition mapPosition, MapTile tile) { if (!selectedTiles.containsKey(mapPosition)) { adjustOffsets(mapPosition); selectedTiles.put(mapPosition, tile); } } MapSelection(); void addSelectedTile(@Nonnull MapPosition mapPosition, MapTile tile); int getOffsetX(); int getOffsetY(); @Nonnull Collection<MapPosition> getSelectedPositions(); MapTile getMapTileAt(MapPosition position); }
MapSelection { public void addSelectedTile(@Nonnull MapPosition mapPosition, MapTile tile) { if (!selectedTiles.containsKey(mapPosition)) { adjustOffsets(mapPosition); selectedTiles.put(mapPosition, tile); } } MapSelection(); void addSelectedTile(@Nonnull MapPosition mapPosition, MapTile tile); int getOffsetX(); int getOffsetY(); @Nonnull Collection<MapPosition> getSelectedPositions(); MapTile getMapTileAt(MapPosition position);  }