source: java-rpg-common/MapElement.java@ d6c8eb6

Last change on this file since d6c8eb6 was 04e7260, checked in by dportnoy <dmp1488@…>, 17 years ago

[svn r20]

  • Property mode set to 100644
File size: 792 bytes
Line 
1import java.awt.image.*;
2import java.io.IOException;
3
4import javax.imageio.ImageIO;
5
6public 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.