anecho.JamochaMUD
Class EnumPlugIns

java.lang.Object
  extended by anecho.JamochaMUD.EnumPlugIns

public class EnumPlugIns
extends java.lang.Object

EnumPlugIns.java enumerates plugins at program start-up, and contains functions for managing them once the program is loaded


Field Summary
static java.lang.String INPUT
          Output type of plug-in, used for identifying type of commands this plug-in watches
static java.lang.String OUTPUT
          Output type of plug-in, used for identifying type of commands this plug-in watches
static java.util.Vector plugInClass
          A vector containing all the plug-in classes
static java.util.Vector plugInName
          A vector containing all the names of the plug-ins.
static java.util.Vector plugInStatus
          A vector containing the status of all the plug-ins.
static java.util.Vector plugInType
          A Vector containing the type of all the plug-ins.
 
Method Summary
 void activate(int plugNum)
          Update out internal list and activate the plug-in
 void addNewPlugIn()
          Update out internal list and deactivate the plug-in
static java.lang.String callPlugin(java.lang.String target, java.lang.String plugType, MuSocket mSock)
          Analyse the input/output and cycle through the list of plugins, applying any where the input/output meets the right criteria
static java.lang.Object classByName(java.lang.String targetName)
          Return the plugin object for the name given
 void deactivate(int plugNum)
          Update out internal list and deactivate the plug-in
static java.lang.String description(java.lang.String targetName)
          This method returns the user-readable description of the given plug-ins function.
static EnumPlugIns getInstance()
          Get the instance of our singleton.
 void haltPlugIns()
          Loop through the plugins and tell them all to "halt"
 void loadPlugIns(java.lang.Object splash)
          Load the JamochaMUD plug-ins.
 void removePlugIn()
          Remove (erase) a plug-in that is currently installed with JamochaMUD.
 void resetPlugInStatus()
          Set the status of the plugins, whether they are active or inactive
static void write(java.lang.String text)
          A static method to allow a plug-in to write output to the screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plugInClass

public static java.util.Vector plugInClass
A vector containing all the plug-in classes


plugInName

public static java.util.Vector plugInName
A vector containing all the names of the plug-ins.


plugInType

public static java.util.Vector plugInType
A Vector containing the type of all the plug-ins.


plugInStatus

public static java.util.Vector plugInStatus
A vector containing the status of all the plug-ins.


INPUT

public static final java.lang.String INPUT
Output type of plug-in, used for identifying type of commands this plug-in watches

See Also:
Constant Field Values

OUTPUT

public static final java.lang.String OUTPUT
Output type of plug-in, used for identifying type of commands this plug-in watches

See Also:
Constant Field Values
Method Detail

getInstance

public static EnumPlugIns getInstance()
Get the instance of our singleton.

Returns:
Returns the singleton instance of our EnumPlugins class

loadPlugIns

public void loadPlugIns(java.lang.Object splash)
Load the JamochaMUD plug-ins. If a splash-screen component is used the splash-screen will display the names of the plug-ins as they are loaded.

Parameters:
splash - The anecho.gui.SplashScreen object (if used).

callPlugin

public static java.lang.String callPlugin(java.lang.String target,
                                          java.lang.String plugType,
                                          MuSocket mSock)
Analyse the input/output and cycle through the list of plugins, applying any where the input/output meets the right criteria

Parameters:
target - The initial string that the plug-in will operate on.
plugType - A string representing the type of plug-in currently being processed
mSock - The MuSock that this plug-in is being called by. This ensures that the input/output is being processed for the proper MU*.
Returns:
The string represents the final output from the current plug-in, which may or may not have changed depending on the plug-in's function

resetPlugInStatus

public void resetPlugInStatus()
Set the status of the plugins, whether they are active or inactive


description

public static java.lang.String description(java.lang.String targetName)
This method returns the user-readable description of the given plug-ins function.

Parameters:
targetName - Name of the plug-in to examine.
Returns:
A user-readable text description of the plug-in's features.

classByName

public static java.lang.Object classByName(java.lang.String targetName)
Return the plugin object for the name given

Parameters:
targetName -
Returns:

write

public static void write(java.lang.String text)
A static method to allow a plug-in to write output to the screen. There may need to be more done than what can simply be done at the time of "processing" Should the CHandler method be moved here? Fix Me XXX

Parameters:
text - The text to be written out to the user's display.

activate

public void activate(int plugNum)
Update out internal list and activate the plug-in

Parameters:
plugNum - The index number of the plug-in we wish to activate

deactivate

public void deactivate(int plugNum)
Update out internal list and deactivate the plug-in

Parameters:
plugNum - The index number of the plug-in we wish to deactivate

haltPlugIns

public void haltPlugIns()
Loop through the plugins and tell them all to "halt"


addNewPlugIn

public void addNewPlugIn()
Update out internal list and deactivate the plug-in


removePlugIn

public void removePlugIn()
Remove (erase) a plug-in that is currently installed with JamochaMUD. This is currently an empty method. Fix Me XXX.