Last active
August 29, 2015 14:00
-
-
Save sylvia43/bd513c2a17c4b33c9357 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum ImageLibrary { | |
INFANTRY_SPRITE("infantry.png"), | |
TANK_SPRITE("tank.png"); | |
BufferedImage img; | |
ImageLibrary(String filepath) { | |
try { | |
img = ImageIO.read(new File(filepath)); | |
} catch (IOException e) { | |
throw new RuntimeException("Could not load a file: " + e); | |
} | |
} | |
public BufferedImage getImage() { | |
return img; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment