2011-09-24 12:04:49 +02:00
|
|
|
package com.massivecraft.factions.struct;
|
|
|
|
|
2011-10-09 14:53:38 +02:00
|
|
|
public enum ChatMode
|
|
|
|
{
|
2011-09-24 12:04:49 +02:00
|
|
|
FACTION(2, "faction chat"),
|
|
|
|
ALLIANCE(1, "alliance chat"),
|
|
|
|
PUBLIC(0, "public chat");
|
|
|
|
|
|
|
|
public final int value;
|
|
|
|
public final String nicename;
|
|
|
|
|
2011-10-09 14:53:38 +02:00
|
|
|
private ChatMode(final int value, final String nicename)
|
|
|
|
{
|
2011-09-24 12:04:49 +02:00
|
|
|
this.value = value;
|
|
|
|
this.nicename = nicename;
|
|
|
|
}
|
|
|
|
|
2011-10-09 14:53:38 +02:00
|
|
|
public boolean isAtLeast(ChatMode role)
|
|
|
|
{
|
2011-09-24 12:04:49 +02:00
|
|
|
return this.value >= role.value;
|
|
|
|
}
|
|
|
|
|
2011-10-09 14:53:38 +02:00
|
|
|
public boolean isAtMost(ChatMode role)
|
|
|
|
{
|
2011-09-24 12:04:49 +02:00
|
|
|
return this.value <= role.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2011-10-09 14:53:38 +02:00
|
|
|
public String toString()
|
|
|
|
{
|
2011-09-24 12:04:49 +02:00
|
|
|
return this.nicename;
|
|
|
|
}
|
2011-10-09 14:53:38 +02:00
|
|
|
|
|
|
|
public ChatMode getNext()
|
|
|
|
{
|
|
|
|
if (this == PUBLIC) return ALLIANCE;
|
|
|
|
if (this == ALLIANCE)return FACTION;
|
|
|
|
return PUBLIC;
|
|
|
|
}
|
2011-09-24 12:04:49 +02:00
|
|
|
}
|