public enum BulletState extends Enum<BulletState>
Enum Constant and Description |
---|
EXPLODED
The bullet currently represents a robot explosion, i.e. a robot death.
|
FIRED
The bullet has just been fired this turn and hence just been created.
|
HIT_BULLET
The bullet has hit another bullet.
|
HIT_VICTIM
The bullet has hit a robot victim.
|
HIT_WALL
The bullet has hit the wall, i.e. one of the four borders of the battlefield.
|
INACTIVE
The bullet is currently inactive.
|
MOVING
The bullet is now moving across the battlefield, but has not hit anything yet.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue()
Returns the state as an integer value.
|
boolean |
isActive() |
static BulletState |
toState(int value)
Returns a BulletState based on an integer value that represents a BulletState.
|
static BulletState |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BulletState[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BulletState FIRED
public static final BulletState MOVING
public static final BulletState HIT_VICTIM
public static final BulletState HIT_BULLET
public static final BulletState HIT_WALL
public static final BulletState EXPLODED
public static final BulletState INACTIVE
public static BulletState[] values()
for (BulletState c : BulletState.values()) System.out.println(c);
public static BulletState 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 int getValue()
toState(int)
public static BulletState toState(int value)
value
- the integer value that represents a specific BulletState.IllegalArgumentException
- if the specified value does not correspond
to a BulletState and hence is invalid.getValue()
public boolean isActive()
Copyright © 2021 Robocode. All Rights Reserved.