Factions/src/org/mcteam/factions/struct/Relation.java

38 lines
782 B
Java
Raw Normal View History

2011-04-08 15:51:07 +02:00
package org.mcteam.factions.struct;
2011-02-06 13:36:11 +01:00
import org.bukkit.ChatColor;
2011-04-08 15:51:07 +02:00
import org.mcteam.factions.Conf;
2011-02-06 13:36:11 +01:00
public enum Relation {
MEMBER(3, "member"),
ALLY(2, "ally"),
NEUTRAL(1, "neutral"),
ENEMY(0, "enemy");
public final int value;
public final String nicename;
private Relation(final int value, final String nicename) {
this.value = value;
this.nicename = nicename;
}
@Override
public String toString() {
return this.nicename;
}
public ChatColor getColor() {
if (this == Relation.MEMBER) {
return Conf.colorMember;
} else if (this == Relation.ALLY) {
return Conf.colorAlly;
} else if (this == Relation.NEUTRAL) {
return Conf.colorNeutral;
} else { //if (relation == FactionRelation.ENEMY) {
return Conf.colorEnemy;
}
2011-02-06 13:36:11 +01:00
}
}