View Javadoc

1   package nl.tudelft.goal.ut3.messages;
2   
3   public enum Combo {
4   
5   		BERSERK("xGame.ComboBerserk"), 
6   		BOOSTER("xGame.ComboDefensive"), 
7   		INVISIBILITY("xGame.ComboInvis"), 
8   		SPEED("xGame.ComboSpeed");
9   	
10  	private String utName;
11  	
12  	private Combo(String utName){
13  		this.utName = utName;
14  	}
15  	
16  	@Override
17  	public String toString(){
18  		return utName;
19  	}
20  
21  	public static Combo valueOfIgnoresCase(String comboString) {
22  		return Combo.valueOf(comboString.toUpperCase());
23  	}
24  	
25  	public static Combo parseCombo(String comboString){
26  		for(Combo c : Combo.values()){
27  			if(c.utName.equals(comboString)){
28  				return c;
29  			}
30  		}
31  		
32  		return null;
33  	}
34  }