public enum UnitType extends Enum<UnitType>
Enum Constant and Description |
---|
AIR_BASE |
BATTLE_SHIP |
BOMBER |
CARRIER |
CITY |
EXPLOSION |
FIGHTER |
FLEET |
GUNSHOT |
INVALID |
NUKE |
NUM_OBJECTS |
QUEUE_ITEM |
RADAR |
SAUCER |
SILO |
SUB |
TORNADO |
Modifier and Type | Field and Description |
---|---|
static EnumSet<UnitType> |
air
Contains all air units that can receive commands.
|
static EnumSet<UnitType> |
ground
Contains all ground units that can receive commands.
|
int |
id
Holds integer (defcon) unit type of this unit..type.
|
static EnumSet<UnitType> |
misc
All other types.
|
static EnumSet<UnitType> |
naval
Contains all naval units that can receive commands.
|
static EnumSet<UnitType> |
units
Contains all units that can receive commands.
|
Modifier and Type | Method and Description |
---|---|
Class<? extends DefConObject> |
getClassOfUnitType()
Provides mapping from UnitType to DefConObject class
|
static Class<? extends DefConObject> |
getClassOfUnitType(UnitType data)
Provides mapping from UnitType to DefConObject class
|
static UnitType |
getEnum(int id)
Returns appropriate UnitType for given integer.
|
static DefConObject |
getInstanceOfUnitTypeFromUnitData(JBot.UnitData data,
double time)
Factory styled method, which provides you with an appropriate instance of unit
object based on the given UnitData data.
|
boolean |
isAir()
Is the unit airborne?
|
boolean |
isGround()
Is it ground unit?
|
boolean |
isMisc()
Is it misc?
|
boolean |
isNaval()
Is it naval unit?
|
boolean |
isUnit()
May the unit receive commands?
|
static UnitType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static UnitType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final UnitType INVALID
public static final UnitType CITY
public static final UnitType SILO
public static final UnitType RADAR
public static final UnitType NUKE
public static final UnitType EXPLOSION
public static final UnitType SUB
public static final UnitType BATTLE_SHIP
public static final UnitType AIR_BASE
public static final UnitType FIGHTER
public static final UnitType BOMBER
public static final UnitType CARRIER
public static final UnitType TORNADO
public static final UnitType SAUCER
public static final UnitType FLEET
public static final UnitType GUNSHOT
public static final UnitType QUEUE_ITEM
public static final UnitType NUM_OBJECTS
public final int id
public static final EnumSet<UnitType> units
SILO, RADAR, NUKE, SUB, BATTLE_SHIP, AIR_BASE, FIGHTER, BOMBER, CARRIER, FLEET TODO: should NUKE be here?
public static final EnumSet<UnitType> air
NUKE, FIGHTER, BOMBER TODO: should NUKE be here?
public static final EnumSet<UnitType> naval
SUB, BATTLE_SHIP, CARRIER, FLEET
public static final EnumSet<UnitType> ground
SILO, RADAR, AIR_BASE
public static UnitType[] values()
for (UnitType c : UnitType.values()) System.out.println(c);
public static UnitType 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 static UnitType getEnum(int id)
id
- integer (defcon) id typepublic boolean isUnit()
SILO, RADAR, NUKE, SUB, BATTLE_SHIP, AIR_BASE, FIGHTER, BOMBER, CARRIER, FLEET
public boolean isAir()
NUKE, FIGHTER, BOMBER
public boolean isGround()
SILO, RADAR, AIR_BASE
public boolean isNaval()
SUB, BATTLE_SHIP, CARRIER, FLEET
public boolean isMisc()
INVALID, CITY, EXPLOSION, TORNADO, SAUCER, GUNSHOT, QUEUE_ITEM, NUM_OBJECTS
public static DefConObject getInstanceOfUnitTypeFromUnitData(JBot.UnitData data, double time)
data
- unit datatime
- time of creationpublic Class<? extends DefConObject> getClassOfUnitType()
public static Class<? extends DefConObject> getClassOfUnitType(UnitType data)
data
- unit typeCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.