Initial commit
This commit is contained in:
26
src/main/java/se/urmo/game/map/MapTile.java
Normal file
26
src/main/java/se/urmo/game/map/MapTile.java
Normal file
@ -0,0 +1,26 @@
|
||||
package se.urmo.game.map;
|
||||
|
||||
import se.urmo.game.util.MiscUtil;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class MapTile {
|
||||
private final int value;
|
||||
private final BufferedImage image;
|
||||
private final boolean solid;
|
||||
|
||||
public MapTile(int value) {
|
||||
this.value = value;
|
||||
this.image = value != 0 ? MiscUtil.createOutlinedBox(16, 16, Color.blue, 2) : null;
|
||||
this.solid = value != 0;
|
||||
}
|
||||
|
||||
public BufferedImage getImage() {
|
||||
return this.image;
|
||||
}
|
||||
|
||||
public boolean isPassable() {
|
||||
return ! this.solid;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user