|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectgameComponents.TargetServices
public class TargetServices
This utility class provides a number of methods that are useful for defining and dealing with targets in the context of a shooter game. The class encapsulates information about N different types of targets. Each target type is identified by a unique index number, starting from 0 and ranging up the the value N-1. For each index, three attributes are defined: the points value of the target, the colour of the target, and the size of the target. These three values together can be used to create a specific kind of target.
Method Summary | |
---|---|
static java.awt.Color |
getColorForIndex(int index)
Returns the colour of the target type with the specified index number. |
static java.lang.String |
getColorName(int rgbValue)
Returns the text label for the given RGB integer value, if one exists. |
static int |
getNumberOfPossibleTargets()
Returns the total number of targets defined by this utility class. |
static java.lang.Integer |
getPointsForIndex(int index)
Returns the points value of the target type with the specified index number. |
static java.lang.Integer |
getSizeForIndex(int index)
Returns the size attribute of the target type with the specified index number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int getNumberOfPossibleTargets()
public static java.lang.String getColorName(int rgbValue)
public static java.awt.Color getColorForIndex(int index)
index
- must be a value in the range [0,N-1] (where N is the total
number of targets defined)
public static java.lang.Integer getSizeForIndex(int index)
index
- must be a value in the range [0,N-1] (where N is the total
number of targets defined)
public static java.lang.Integer getPointsForIndex(int index)
index
- must be a value in the range [0,N-1] (where N is the total
number of targets defined)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |