robocode.naval
Enum ComponentType

java.lang.Object
  extended by java.lang.Enum<ComponentType>
      extended by robocode.naval.ComponentType
All Implemented Interfaces:
Serializable, Comparable<ComponentType>

public enum ComponentType
extends Enum<ComponentType>

Describes what the component represents. It assigns a type value.

Note: When you subtract the bitmask from the same series of that of the component from its type, you will end with an index starting from the number 1.

Since:
1.8.3.0 Alpha 1
Version:
0.1
Author:
Thales B.V. / Jiri Waning

Enum Constant Summary
COMBI_BITMASK
          The bitmask for the combination series.
COMBI_RADAR_WEAPON
          This component represents a combination between a radar and a weapon.
MINE_BITMASK
           
MINE_STANDARD
           
RADAR_BITMASK
          The bitmask for the radar series.
RADAR_LONG_DYNAMIC
          The long range radar that can rotate around its own Z-axe.
RADAR_LONG_STATIC
          The long range radar fixed towards a certain angle.
RADAR_SHORT_DYNAMIC
          The short range radar that can rotate around its own Z-axe.
RADAR_SHORT_STATIC
          The short range radar fixed towards a certain angle.
UNDEFINED
          The initial state of a component.
UNKNOWN
          The type of the component is not know to us.
WEAPON_BITMASK
          The bitmask of the weapon series.
WEAPON_PORT
          The weapon on the left side of the ship.
WEAPON_PROW
          The weapon on the front end of the ship.
WEAPON_STARBOARD
          The weapon on the right side of the ship.
WEAPON_STERN
          The weapon on the back end of the ship.
 
Method Summary
 boolean fromSeries(ComponentType bitMask)
          Determines if the type matches a certain bitmask series.
static ComponentType getValue(int value)
          Get the CI value matching the given integer value.
 int toInt()
          Get the integer value of the component type.
static ComponentType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ComponentType[] 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

UNDEFINED

public static final ComponentType UNDEFINED
The initial state of a component.


UNKNOWN

public static final ComponentType UNKNOWN
The type of the component is not know to us.


WEAPON_BITMASK

public static final ComponentType WEAPON_BITMASK
The bitmask of the weapon series.


WEAPON_PROW

public static final ComponentType WEAPON_PROW
The weapon on the front end of the ship.


WEAPON_STARBOARD

public static final ComponentType WEAPON_STARBOARD
The weapon on the right side of the ship.


WEAPON_STERN

public static final ComponentType WEAPON_STERN
The weapon on the back end of the ship.


WEAPON_PORT

public static final ComponentType WEAPON_PORT
The weapon on the left side of the ship.


RADAR_BITMASK

public static final ComponentType RADAR_BITMASK
The bitmask for the radar series.


RADAR_LONG_STATIC

public static final ComponentType RADAR_LONG_STATIC
The long range radar fixed towards a certain angle.


RADAR_LONG_DYNAMIC

public static final ComponentType RADAR_LONG_DYNAMIC
The long range radar that can rotate around its own Z-axe.


RADAR_SHORT_STATIC

public static final ComponentType RADAR_SHORT_STATIC
The short range radar fixed towards a certain angle.


RADAR_SHORT_DYNAMIC

public static final ComponentType RADAR_SHORT_DYNAMIC
The short range radar that can rotate around its own Z-axe.


MINE_BITMASK

public static final ComponentType MINE_BITMASK

MINE_STANDARD

public static final ComponentType MINE_STANDARD

COMBI_BITMASK

public static final ComponentType COMBI_BITMASK
The bitmask for the combination series.


COMBI_RADAR_WEAPON

public static final ComponentType COMBI_RADAR_WEAPON
This component represents a combination between a radar and a weapon.

Method Detail

values

public static ComponentType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ComponentType c : ComponentType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ComponentType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getValue

public static ComponentType getValue(int value)
Get the CI value matching the given integer value.

Parameters:
value - The integer value of the component.
Returns:
The CI of the component.

toInt

public int toInt()
Get the integer value of the component type.

Returns:
The integer value of the component type.

fromSeries

public boolean fromSeries(ComponentType bitMask)
Determines if the type matches a certain bitmask series.

Parameters:
bitMask - The series to whom it has to belong.
Returns:
true if this ComponentType is a member of the given series; false otherwise.


Copyright © 2015 Robocode. All Rights Reserved.