MineLittlePony/src/main/java/com/minelittlepony/minelp/PonyLevel.java

24 lines
486 B
Java
Raw Normal View History

2015-08-02 00:36:33 +02:00
package com.minelittlepony.minelp;
public enum PonyLevel {
PONIES,
HUMANS,
MIXED;
private static final PonyLevel[] oldValues = { HUMANS, MIXED, PONIES };
public static PonyLevel parse(int intValue) {
if (intValue < 0)
intValue = 0;
if (intValue > 2)
intValue = 2;
// it's an old value
return oldValues[intValue];
}
@Override
public String toString() {
return name().toString();
}
}