RuneHive-Game
Loading...
Searching...
No Matches
ClanRank.java
Go to the documentation of this file.
1package com.runehive.content.clanchannel;
2
3/**
4 * The enum containing all the rank's data within a clan channel.
5 *
6 * @author Daniel.
7 */
8public enum ClanRank {
9 MEMBER("Member", -1),
10 FRIEND("Friend", 0),
11 RECRUIT("Recruit", 1),
12 CORPORAL("Corporal", 2),
13 SERGEANT("Sergeant", 3),
14 LIEUTENANT("Lieutenant", 4),
15 CAPTAIN("Captain", 5),
16 GENERAL("General", 6),
17 LEADER("Leader", 7),
18 SYSTEM("System", 8);
19
20 /** The name of the clan rank. */
21 public final String name;
22
23 /** The rank index. */
24 public final int rank;
25
26 /** Constructs a new <code>ClanRank</code>. */
27 ClanRank(String name, int rank) {
28 this.name = name;
29 this.rank = rank;
30 }
31
32 public boolean lessThan(ClanRank other) {
33 return rank < other.rank;
34 }
35
36 public boolean greaterThanEqual(ClanRank other) {
37 return rank >= other.rank;
38 }
39
40 public String getName() {
41 return this == MEMBER ? "Anyone" : name;
42 }
43
44 public String getString() {
45 return this == MEMBER ? "" : ("<clan=" + rank + ">");
46 }
47}
ClanRank(String name, int rank)
Constructs a new ClanRank.
Definition ClanRank.java:27
final String name
The name of the clan rank.
Definition ClanRank.java:21
boolean greaterThanEqual(ClanRank other)
Definition ClanRank.java:36