36 lines
970 B
Java
36 lines
970 B
Java
import java.awt.*;
|
|
import java.util.Arrays;
|
|
|
|
public class WaterMap extends AbstractMap {
|
|
private final Color barrierColor = Color.green;
|
|
private final Color roadColor = new Color(165, 42, 42, 255);
|
|
|
|
@Override
|
|
protected void drawBarrierPart(Graphics2D g, int i, int j)
|
|
{
|
|
g.setColor(barrierColor);
|
|
g.fillRect(j * (int) _size_x, i * (int) _size_y, (int) _size_x, (int) _size_y);
|
|
}
|
|
|
|
@Override
|
|
protected void drawRoadPart(Graphics2D g, int i, int j)
|
|
{
|
|
g.setColor(roadColor);
|
|
g.fillRect(j * (int) _size_x, i * (int) _size_y, (int) _size_x, (int) _size_y);
|
|
}
|
|
|
|
@Override
|
|
protected void generateMap() {
|
|
_map = new int[50][50];
|
|
_size_x = (float)_width / _map[0].length;
|
|
_size_y = (float)_height / _map.length;
|
|
int counter = 0;
|
|
for (int[] row : _map) {
|
|
Arrays.fill(row, _freeRoad);
|
|
}
|
|
while (counter < 10)
|
|
{
|
|
|
|
}
|
|
}
|
|
} |