RuneHive-Game
Loading...
Searching...
No Matches
ClanLevel.java
Go to the documentation of this file.
1package com.runehive.content.clanchannel.content;
2
3/**
4 * Handles the clan levels (based off the total experience earned).
5 *
6 * @author Daniel
7 */
8public enum ClanLevel {
9 BRONZE(0, 0, "553E21"),
10 IRON(50_000, 5, "484242"),
11 STEEL(150_000, 15, "867B7B"),
12 BLACK(300_000, 30, "1E1C1C"),
13 MITHRIL(750_000, 50, "3D48BF"),
14 ADAMANT(1_500_000, 75, "3B4E3B"),
15 RUNE(3_000_000, 115, "4A6775"),
16 DRAGON(6_000_000, 165, "782924"),
17 BARROW(10_000_000, 250, "4F614B"),
18 GILDED(18_000_000, 500, "EBC41A"),
19 GODLY(30_000_000, 800, "E0D290"),
20 THIRD_AGE(50_000_000, 1250, "59b9ff"),
21 RARE(100_000_000, 2500, "D468F2");
22
23 /** The experience of the level. */
24 private final long experience;
25
26 /** The clan points rewarded. */
27 private final int points;
28
29 /** The clan level color. */
30 private final String color;
31
32 /** The clan level. */
33 ClanLevel(long experience, int points, String color) {
34 this.experience = experience;
35 this.points = points;
36 this.color = color;
37 }
38
39 /** Gets the experience of the clan level. */
40 public long getExperience() {
41 return experience;
42 }
43
44 /** Gets the points rewarded for leveling up. */
45 public int getPoints() {
46 return points;
47 }
48
49 /** Gets the clan level color. */
50 public String getColor() {
51 return color;
52 }
53
54 /** Gets a clan level based off the experience. */
55 public static ClanLevel getLevel(double experience) {
56 ClanLevel level = BRONZE;
57 for (ClanLevel levels : values()) {
58 if (experience >= levels.getExperience())
59 level = levels;
60 }
61 return level;
62 }
63}
final int points
The clan points rewarded.
ClanLevel(long experience, int points, String color)
The clan level.
int getPoints()
Gets the points rewarded for leveling up.
long getExperience()
Gets the experience of the clan level.
static ClanLevel getLevel(double experience)
Gets a clan level based off the experience.
String getColor()
Gets the clan level color.
final long experience
The experience of the level.
final String color
The clan level color.