Serializable
, Comparable<Food.Type>
@ThreadSafe public static enum Food.Type extends Enum<Food.Type>
Name | Radius | Energy | Damage |
---|---|---|---|
APPLE | 20 | 20 ± 1 | 20 ± 1 |
BANANA | 20 | 20 ± 2 | 20 ± 1 |
RASPBERRY | 10 | 10 ± 1 | 10 ± 2 |
BROCCOLI | 20 | 50 ± 1 | 10 ± 1 |
MILK | 20 | 50 ± 1 | 20 ± 5 |
CHOCOLATE | 20 | 50 ± 1 | 20 ± 1 |
SANDWICH | 20 | 50 ± 2 | 20 ± 1 |
PIE | 50 | 50 ± 1 | 100 ± 1 |
For information about what the "±" means, please see the
RandomScalar
class.
Enum Constant | Description |
---|---|
APPLE |
An apple.
|
BANANA |
A banana.
|
BROCCOLI |
A piece of broccoli.
|
CHOCOLATE |
A bar of chocolate.
|
MILK |
A milk carton.
|
PIE |
A pie, the most powerful weapon.
|
RASPBERRY |
A raspberry, the least powerful piece of food.
|
SANDWICH |
A sandwich.
|
Modifier and Type | Method | Description |
---|---|---|
RandomScalar |
getDamage() |
Returns the damage incurred when a player collides with an airborne
food piece of this type.
|
RandomScalar |
getEnergy() |
Returns the energy gained by eating food of this type.
|
double |
getRadius() |
Returns the radius of food pieces of this type.
|
String |
toString() |
Returns a human-readable name for this food type that differs from
what will be returned by
Enum.name() . |
static Food.Type |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static Food.Type[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@SerializedName("apple") public static final Food.Type APPLE
@SerializedName("banana") public static final Food.Type BANANA
@SerializedName("raspberry") public static final Food.Type RASPBERRY
@SerializedName("broccoli") public static final Food.Type BROCCOLI
@SerializedName("milk") public static final Food.Type MILK
@SerializedName("chocolate") public static final Food.Type CHOCOLATE
@SerializedName("sandwich") public static final Food.Type SANDWICH
@SerializedName("pie") public static final Food.Type PIE
public static Food.Type[] values()
for (Food.Type c : Food.Type.values()) System.out.println(c);
public static Food.Type valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String toString()
Enum.name()
. It will be a bit more
readable by human eyes, and is intended primarily for debugging
purposes.public double getRadius()
public RandomScalar getEnergy()
Player.getEnergy()
will increase by this amount.public RandomScalar getDamage()