|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<UnitType>
cz.cuni.amis.pogamut.defcon.consts.UnitType
public enum UnitType
Contains all types of defcon units and supplies user with a factory method for each of them. GENERATED by GameObjectsFactoryGenerator.xslt so any modifications should go there!!!
Enum Constant Summary | |
---|---|
AIR_BASE
|
|
BATTLE_SHIP
|
|
BOMBER
|
|
CARRIER
|
|
CITY
|
|
EXPLOSION
|
|
FIGHTER
|
|
FLEET
|
|
GUNSHOT
|
|
INVALID
|
|
NUKE
|
|
NUM_OBJECTS
|
|
QUEUE_ITEM
|
|
RADAR
|
|
SAUCER
|
|
SILO
|
|
SUB
|
|
TORNADO
|
Field Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
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
Field Detail |
---|
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 final EnumSet<UnitType> misc
INVALID, CITY, EXPLOSION, TORNADO, SAUCER, GUNSHOT, QUEUE_ITEM, NUM_OBJECTS
Method Detail |
---|
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 name
NullPointerException
- if the argument is nullpublic static UnitType getEnum(int id)
id
- integer (defcon) id type
public 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 creation
public Class<? extends DefConObject> getClassOfUnitType()
public static Class<? extends DefConObject> getClassOfUnitType(UnitType data)
data
- unit type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |