Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jim Bilbrey
committed
Apr 10, 2013
1 parent
8ea48d7
commit 98f76b8
Showing
4 changed files
with
91 additions
and
87 deletions.
There are no files selected for viewing
47 changes: 7 additions & 40 deletions
47
src/main/java/com/laytonsmith/abstraction/enums/MCCriteria.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,24 @@ | ||
package com.laytonsmith.abstraction.enums; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Criteria names which trigger an objective to be modified by actions in-game | ||
* | ||
* @author jb_aero | ||
*/ | ||
public enum MCCriteria { | ||
DEATH_COUNT("deathCount"), | ||
DEATHCOUNT("deathCount"), | ||
HEALTH("health"), | ||
PLAYER_KILL_COUNT("playerKillCount"), | ||
TOTAL_KILL_COUNT("totalKillCount"), | ||
/** | ||
* This is the exception, all user defined criteria use this. | ||
*/ | ||
PLAYERKILLCOUNT("playerKillCount"), | ||
TOTALKILLCOUNT("totalKillCount"), | ||
DUMMY("dummy"); | ||
|
||
private String criteria; | ||
|
||
MCCriteria(String crit) { | ||
this.criteria = crit; | ||
} | ||
|
||
public String getValue() { | ||
return this.criteria; | ||
} | ||
|
||
/** | ||
* @return List of the criteria automatically incremented by the server | ||
*/ | ||
public static List<String> auto() { | ||
List<String> ret = new ArrayList<String>(); | ||
for (MCCriteria c : values()) { | ||
if (c != MCCriteria.DUMMY) { | ||
ret.add(c.name()); | ||
ret.add(c.getValue()); | ||
} | ||
} | ||
return ret; | ||
private MCCriteria(String crit) { | ||
criteria = crit; | ||
} | ||
|
||
public static MCCriteria convert(String value) { | ||
MCCriteria ret = MCCriteria.DUMMY; | ||
for (MCCriteria c : values()) { | ||
if (c.getValue().equals(value)) { | ||
ret = c; | ||
} | ||
if (c.name().equals(value.toUpperCase())) { | ||
ret = c; | ||
} | ||
} | ||
return ret; | ||
public String getCriteria() { | ||
return criteria; | ||
} | ||
} |
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
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
Oops, something went wrong.