Last change
on this file since a49176d was 8edd04e, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 5 years ago |
Make the decompiled game code compile successfully
|
-
Property mode
set to
100644
|
File size:
936 bytes
|
Rev | Line | |
---|
[8edd04e] | 1 | package main;
|
---|
| 2 |
|
---|
| 3 | import java.awt.image.BufferedImage;
|
---|
| 4 | import java.io.IOException;
|
---|
| 5 |
|
---|
| 6 | import javax.imageio.ImageIO;
|
---|
| 7 |
|
---|
| 8 | public class MapElement {
|
---|
| 9 |
|
---|
| 10 | private BufferedImage img;
|
---|
| 11 | private boolean passable;
|
---|
| 12 |
|
---|
| 13 | public MapElement(BufferedImage img, boolean passable) {
|
---|
| 14 | this.img = img;
|
---|
| 15 | this.passable = passable;
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | public MapElement(String imgFile, boolean passable) {
|
---|
| 19 | try {
|
---|
| 20 | this.img = ImageIO.read(getClass().getResource("../images/" + imgFile));
|
---|
| 21 | this.passable = passable;
|
---|
| 22 | } catch (IOException ioe) {
|
---|
| 23 | ioe.printStackTrace();
|
---|
| 24 | }
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | public MapElement(MapElement copy) {
|
---|
| 28 | this.img = copy.img;
|
---|
| 29 | this.passable = copy.passable;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | public BufferedImage getImg() {
|
---|
| 33 | return this.img;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | public boolean isPassable() {
|
---|
| 37 | return this.passable;
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | public void setImg(BufferedImage img) {
|
---|
| 41 | this.img = img;
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | public void setPassable(boolean passable) {
|
---|
| 45 | this.passable = passable;
|
---|
| 46 | }
|
---|
| 47 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.