|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.helper.Helper
The base class for all helpers in the system. This class is analogous to the Module class for modules.
Field Summary | |
private DebugType[] |
debugTypes
The debug types that this helper supports. |
private HelperName |
helperName
The name of the helper. |
private HashMap |
helpers
The key is a HelperType object, and the value is a Helper object. |
private GameId |
id
The game that this helper is associated with. |
private Mode |
mode
The mode of the game that this helper is used in. |
private Component |
parent
The component that this helper is associated with. |
private float |
time
|
Constructor Summary | |
protected |
Helper(GameId id,
Mode m,
HelperName name,
Component component)
Create the helper object. |
Method Summary | |
protected float |
checkTime()
Return information on how the game as a whole is doing on time. |
Object |
clone()
Clone the helper. |
static Helper |
create(GameId id,
Mode mode,
HelperType type,
Component component)
Create a Helper object. |
protected Helper |
createHelper(HelperType ht)
Create a new helper for the current helper to use. |
protected void |
debug(String msg)
Log a debug message in the Helper. |
protected void |
error(Exception e)
Log an error in the Helper. |
protected void |
error(String msg)
Log an error in the Helper. |
protected void |
fatal(Exception e)
Log a fatal error in the Helper. |
protected void |
fatal(String msg)
Log a fatal error in the Helper. |
protected Helper[] |
getAllHelpers()
Return all of the helpers that this helper is using. |
abstract Debug[] |
getDebugInformation(DebugType[] types)
Return the debug information for this module. |
abstract DebugType[] |
getDebugTypes()
Return the types of debug information that this module supports. |
protected Helper |
getHelper(HelperType ht)
Get the helper of this helper of a particular type. |
HelperName |
getHelperName()
Return the HelperName object. |
protected GameId |
getId()
Get the id that this module is associated with. |
protected Mode |
getMode()
Get the mode for this game. |
Module |
getModule()
Get the Module object with which this helper is ultimately associated. |
Component |
getParent()
Get the parent of this helper. |
abstract ModuleType[] |
getRequiredModuleList()
Get the modules which this helper is dependent on. |
Scheduler |
getScheduler()
Get a Scheduler object for the module that contains this helper. |
protected void |
information(String msg)
Log an information message in the Helper. |
void |
setTime(float t)
Set the time for this module. |
protected void |
warning(Exception e)
Log a warning in the Helper. |
protected void |
warning(String msg)
Log a warning in the Helper. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private DebugType[] debugTypes
private GameId id
private Mode mode
private float time
private HelperName helperName
private Component parent
private HashMap helpers
Constructor Detail |
protected Helper(GameId id, Mode m, HelperName name, Component component) throws InternalErrorException
id
- The id of the gamem
- The mode of the gamename
- The name of the helper being created.component
- The parent of the helper being created.Method Detail |
public static final Helper create(GameId id, Mode mode, HelperType type, Component component) throws InternalErrorException
id
- The id of the game.
InternalErrorException
- Thrown if an error occurs for any reason.protected float checkTime()
protected Mode getMode()
public Object clone()
clone
in class Object
public void setTime(float t) throws IllegalArgumentException
t
- The time to be set.
IllegalArgumentException
- Thrown if t is outside the range of -1.0 to 1.0.public final Scheduler getScheduler()
public Module getModule()
protected void fatal(Exception e)
e
- The exception that was thrown.protected void error(Exception e)
e
- The exception that was thrown.protected void warning(Exception e)
e
- The exception that was thrown.protected void fatal(String msg)
msg
- The message to be logged.protected void error(String msg)
msg
- The message to be logged.protected void warning(String msg)
msg
- The message to be logged.protected void information(String msg)
msg
- The message to be logged.protected void debug(String msg)
msg
- The message to be logged.public Component getParent()
public abstract Debug[] getDebugInformation(DebugType[] types)
types
- Only return a subset of the debug types in this array.
public abstract DebugType[] getDebugTypes()
protected final GameId getId()
public final HelperName getHelperName()
protected Helper[] getAllHelpers()
protected Helper getHelper(HelperType ht) throws NoSuchDataException
ht
- The helper type to be retrieved.
NoSuchDataException
- Thrown if this helper does not
use a helper of that type.protected Helper createHelper(HelperType ht) throws InternalErrorException
ht
- The HelperType of the new helper.
InternalErrorException
- Thrown if the operation fails for any reason.public abstract ModuleType[] getRequiredModuleList()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |