RuneHive-Game
Loading...
Searching...
No Matches
NpcDropChance.java
Go to the documentation of this file.
1
package
com.runehive.game.world.entity.mob.npc.drop;
2
3
import
com.runehive.util.Utility;
4
5
/**
6
* The enumerated type whose elements represent a set of constants used to differ between
7
* {@link NpcDrop} rarities.
8
* @author <a href="http://www.rune-server.org/members/stand+up/">Stand Up</a>
9
* @since 29-1-2017.
10
*/
11
public
enum
NpcDropChance
{
12
ALWAYS
(1, 0),
13
COMMON
(2, 10),
14
UNCOMMON
(3, 50),
15
RARE
(4, 250),
16
VERY_RARE
(5, 500);
17
18
/** The tier of this drop chance. */
19
public
final
int
tier
;
20
21
/** The denominator which is the divisor of a nominator of 1. */
22
public
final
int
weight
;
23
24
/** Constructs a new {@link NpcDropChance}. */
25
NpcDropChance
(
int
tier
,
int
weight
) {
26
this.weight =
weight
;
27
this.tier =
tier
;
28
}
29
30
@Override
31
public
String
toString
() {
32
return
Utility
.
formatEnum
(name());
33
}
34
}
com.runehive.util.Utility
Handles miscellaneous methods.
Definition
Utility.java:27
com.runehive.util.Utility.formatEnum
static String formatEnum(final String string)
Formats name of enum.
Definition
Utility.java:89
com.runehive.game.world.entity.mob.npc.drop.NpcDropChance.toString
String toString()
Definition
NpcDropChance.java:31
com.runehive.game.world.entity.mob.npc.drop.NpcDropChance.ALWAYS
ALWAYS
Definition
NpcDropChance.java:12
com.runehive.game.world.entity.mob.npc.drop.NpcDropChance.weight
final int weight
The denominator which is the divisor of a nominator of 1.
Definition
NpcDropChance.java:22
com.runehive.game.world.entity.mob.npc.drop.NpcDropChance.VERY_RARE
VERY_RARE
Definition
NpcDropChance.java:16
com.runehive.game.world.entity.mob.npc.drop.NpcDropChance.RARE
RARE
Definition
NpcDropChance.java:15
com.runehive.game.world.entity.mob.npc.drop.NpcDropChance.tier
final int tier
The tier of this drop chance.
Definition
NpcDropChance.java:19
com.runehive.game.world.entity.mob.npc.drop.NpcDropChance.UNCOMMON
UNCOMMON
Definition
NpcDropChance.java:14
com.runehive.game.world.entity.mob.npc.drop.NpcDropChance.NpcDropChance
NpcDropChance(int tier, int weight)
Constructs a new NpcDropChance.
Definition
NpcDropChance.java:25
com.runehive.game.world.entity.mob.npc.drop.NpcDropChance.COMMON
COMMON
Definition
NpcDropChance.java:13