Rev | Line | |
---|
[04e7260] | 1 | import java.awt.image.*;
|
---|
| 2 | import java.io.IOException;
|
---|
| 3 |
|
---|
| 4 | import javax.imageio.ImageIO;
|
---|
| 5 |
|
---|
| 6 | public class MapElement {
|
---|
| 7 | private BufferedImage img;
|
---|
| 8 | private boolean passable;
|
---|
| 9 |
|
---|
| 10 | public MapElement(BufferedImage img, boolean passable) {
|
---|
| 11 | this.img = img;
|
---|
| 12 | this.passable = passable;
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | public MapElement(String imgFile, boolean passable) {
|
---|
| 16 | try {
|
---|
| 17 | img = ImageIO.read(getClass().getResource("images/"+imgFile));
|
---|
| 18 | this.passable = passable;
|
---|
| 19 | }catch(IOException ioe) {
|
---|
| 20 | ioe.printStackTrace();
|
---|
| 21 | }
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | public BufferedImage getImg() {
|
---|
| 25 | return img;
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | public boolean isPassable() {
|
---|
| 29 | return passable;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | public void setImg(BufferedImage img) {
|
---|
| 33 | this.img = img;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | public void setPassable(boolean passable) {
|
---|
| 37 | this.passable = passable;
|
---|
| 38 | }
|
---|
| 39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.