RuneHive-Game
Loading...
Searching...
No Matches
PrestigePerk.java
Go to the documentation of this file.
1package com.runehive.content.prestige;
2
3import com.google.common.collect.ImmutableMap;
4
5import java.util.HashMap;
6import java.util.Map;
7
8/**
9 * Handles the perk rewards from prestiging.
10 *
11 * @author Daniel.
12 */
13public enum PrestigePerk {
14 ARROWHEAD("Arrowhead", "Using arrows will not break.", 6798),
15 MASTERBAIRTER("Masterbaiter", "15% chance of catching extra fish.", 6799),
16 DOUBLE_WOOD("Double wood", "15% chance to receive an additional log.", 6800),
17 LITTLE_BIRDY("Little Birdy", "Increase the woodcutting rate of bird nest drops by 15%.", 6801),
18 THE_ROCK("The Rock", "10% chance to receive an additional ore.", 6802),
19 FLAME_ON("Flame On", "25% chance of burning an extra log.", 6803);
20
21 public static final PrestigePerk[] values = values();
22 private static final Map<Integer, PrestigePerk> perkItemMap;
23 private static final Map<Integer, PrestigePerk> perkIdMap;
24
25 static {
26 final Map<Integer, PrestigePerk> itemMap = new HashMap<>();
27 final Map<Integer, PrestigePerk> idMap = new HashMap<>();
28 for (PrestigePerk p : values) {
29 itemMap.put(p.item, p);
30 idMap.put(p.ordinal(), p);
31 }
32
33 perkItemMap = ImmutableMap.copyOf(itemMap);
34 perkIdMap = ImmutableMap.copyOf(idMap);
35 }
36
37 /**
38 * The name of the perk.
39 */
40 public final String name;
41
42 /**
43 * The description of the perk.
44 */
45 public final String description;
46
47 /**
48 * The item identification of the perk.
49 */
50 public final int item;
51
52 /**
53 * Constructs a new <code>PrestigePerk</code>.
54 */
55 PrestigePerk(String name, String description, int item) {
56 this.name = name;
57 this.description = description;
58 this.item = item;
59 }
60
61 public static PrestigePerk forItem(int item) {
62 return perkItemMap.get(item);
63 }
64
65 public static PrestigePerk forId(int id) {
66 return perkIdMap.get(id);
67 }
68}
static final Map< Integer, PrestigePerk > perkIdMap
static final Map< Integer, PrestigePerk > perkItemMap
final String description
The description of the perk.
PrestigePerk(String name, String description, int item)
Constructs a new PrestigePerk.
static PrestigePerk forItem(int item)
final String name
The name of the perk.
final int item
The item identification of the perk.