Skip to content
Permalink
4e38ddf553
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
59 lines (50 sloc) 1.74 KB
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public enum MinionTypes {
//NAME (Health, Attack, Speed, goldValue, sprite file name)
WEAKLING (100, 1, 1, 1, "Weakling Minion.png"),
BASIC (255, 1, 1, 2, "Basic Minion.png"),
SPEEDO (100, 1, 4, 3, "Speedo Minion.png"),
SUPERSPEEDO (255, 1, 4, 5, "Superspeedo Minion.png"),
JUGGERNAUT (1000, 1, 1, 10, "Juggernaut Minion.png"),
// UNKILLABLE (10000, 1, 1, 100, "Unkillable Minion.png"),
DOUBLEBASIC (255, 2, 1, 12, "Double Basic Minion.png"),
// SUPERKILLER (10, 20, 8, 100, "Superkiller Minion.png"),
// HEALTH (2000, -1, 1, -50, "Basic Minion.png"),
MONEYBAGS (350, 1, 2, 50, "Moneybags Minion.png");
private int health, attackDamage, movementSpeed, value;
private BufferedImage sprite;
private static final String SPRITE_FILE_DIR = "src/resources/images/"; //Make sure that the directory name ends in a forward slash
MinionTypes(int health, int attackDamage, int movementSpeed, int value, String spriteFileName) {
this.health = health;
this.attackDamage = attackDamage;
this.movementSpeed = movementSpeed;
this.value = value;
try {
this.sprite = ImageIO.read(new File(SPRITE_FILE_DIR.concat(spriteFileName)));
} catch (IOException ex) {
System.out.println("image not found");
}
}
public int getHealth() {
return health;
}
public int getAttackDamage() {
return attackDamage;
}
public String getName() {
return this.toString();
}
public int getMovementSpeed() {
return movementSpeed;
}
public int getValue() {
return value;
}
public BufferedImage getSprite()
{
return sprite;
}
}