Serializable
, Comparable<Event>
public enum Event extends Enum<Event>
Score
is based on the number of times that each of these events
occurs. Each event has a type, either Event.Type.ONE_TIME
or
Event.Type.ONGOING
. One-time events can happen a maximum of once per team
in a match, while ongoing events can occur multiple times. Each event has a
point value, and a negative point value represents a "bad" event that
competitors may wish to avoid.
Here is a list of all of the one-time events:
FIRST_MOVE
: 1 point
FIRST_PICKUP
: 5 points
FIRST_THROW
: 10 points
FIRST_EAT
: 50 points
FIRST_PLAYER_COLLISION
: -2 points
FIRST_FOOD_COLLISION
: -100 points
EVERY_EAT
: 5 points
FOOD_ON_TABLE
: 1 point
EVERY_PLAYER_COLLISION
: -1 point
EVERY_FOOD_COLLISION
: -500 points
TIE_BREAK
: 1 point
Modifier and Type | Class | Description |
---|---|---|
static class |
Event.Type |
The type of an event, either one-time or ongoing.
|
Enum Constant | Description |
---|---|
EVERY_EAT |
Occurs every time a player performs an "eat" action.
|
EVERY_FOOD_COLLISION |
Occurs every time a player collides with a food piece.
|
EVERY_PLAYER_COLLISION |
Occurs every time a player collides with another.
|
FIRST_EAT |
Occurs when a player performs an "eat" action for the first time.
|
FIRST_FOOD_COLLISION |
Occurs when a player collides with a food piece for the first time.
|
FIRST_MOVE |
Occurs when a player performs a "move" action for the first time.
|
FIRST_PICKUP |
Occurs when a player performs a "pickup" action for the first time.
|
FIRST_PLAYER_COLLISION |
Occurs when a player collides with another for the first time.
|
FIRST_THROW |
Occurs when a player performs a "throw" action for the first time.
|
FOOD_ON_TABLE |
Occurs once per turn for every piece of food on a team's table.
|
TIE_BREAK |
Occurs when a tie must be broken by distance to the center.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getPointValue() |
Gets the value of this event to a team's score.
|
Event.Type |
getType() |
Returns the type of this action, either one-time or ongoing.
|
String |
toString() |
Returns a human-readable name for this event that differs from what will
be returned by
Enum.name() . |
static Event |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static Event[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@SerializedName("firstMove") public static final Event FIRST_MOVE
@SerializedName("firstPickup") public static final Event FIRST_PICKUP
@SerializedName("firstThrow") public static final Event FIRST_THROW
@SerializedName("firstEat") public static final Event FIRST_EAT
@SerializedName("firstPlayerCollision") public static final Event FIRST_PLAYER_COLLISION
@SerializedName("firstFoodCollision") public static final Event FIRST_FOOD_COLLISION
@SerializedName("everyEat") public static final Event EVERY_EAT
@SerializedName("foodOnTable") public static final Event FOOD_ON_TABLE
@SerializedName("everyPlayerCollision") public static final Event EVERY_PLAYER_COLLISION
@SerializedName("everyFoodCollision") public static final Event EVERY_FOOD_COLLISION
@SerializedName("tieBreak") public static final Event TIE_BREAK
public static Event[] values()
for (Event c : Event.values()) System.out.println(c);
public static Event 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 Event.Type getType()
public int getPointValue()