|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdata.scripts.console.BaseCommand
public abstract class BaseCommand
The basic command object that all console commands must extend.
Constructor Summary | |
---|---|
BaseCommand()
|
Method Summary | ||
---|---|---|
protected com.fs.starfarer.api.combat.CombatEngineAPI |
getCombatEngine()
A convenient alias for Console.getCombatEngine() . |
|
protected Console |
getConsole()
A convenient alias for Console.getConsole() . |
|
protected abstract java.lang.String |
getHelp()
A block of text displayed via the 'help' command. |
|
protected com.fs.starfarer.api.campaign.LocationAPI |
getLocation()
Returns the current LocationAPI . |
|
java.lang.String |
getName()
Returns the name of this command. |
|
protected com.fs.starfarer.api.campaign.SectorAPI |
getSector()
Returns the current SectorAPI . |
|
protected com.fs.starfarer.api.campaign.StarSystemAPI |
getStarSystem()
Returns the current StarSystemAPI . |
|
protected abstract java.lang.String |
getSyntax()
A line of text displayed when a command is entered incorrectly. |
|
protected static
|
getVar(java.lang.String varName,
java.lang.Class<T> type)
A convenient alias for Console.getVar(java.lang.String, java.lang.Class) . |
|
protected static java.lang.Class |
getVarType(java.lang.String varName)
A convenient alias for Console.getVarType(java.lang.String) . |
|
protected static boolean |
hasVar(java.lang.String varName)
A convenient alias for Console.hasVar(java.lang.String) . |
|
protected boolean |
isCombatOnly()
Returns whether this command is restricted to battles only. |
|
protected abstract boolean |
runCommand(java.lang.String args)
Run this command with the supplied arguments. |
|
protected static void |
setVar(java.lang.String varName,
java.lang.Object varData)
A convenient alias for Console.setVar(java.lang.String, java.lang.Object) . |
|
protected static void |
showError(java.lang.String preamble,
java.lang.Exception ex)
A convenient alias for Console.showError(java.lang.String, java.lang.Exception) . |
|
void |
showHelp()
Displays the helpfile returned by getHelp() . |
|
protected static void |
showMessage(java.lang.String message)
A convenient alias for Console.showMessage(java.lang.String) . |
|
protected static void |
showMessage(java.lang.String preamble,
java.lang.String message,
boolean indent)
A convenient alias for Console.showMessage(java.lang.String, java.lang.String, boolean) . |
|
void |
showSyntax()
Displays the syntax returned by getSyntax() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseCommand()
Method Detail |
---|
protected final com.fs.starfarer.api.campaign.SectorAPI getSector()
SectorAPI
.
SectorAPI
object used by this campaignprotected final com.fs.starfarer.api.campaign.LocationAPI getLocation()
LocationAPI
.
LocationAPI
the player fleet is occupyingprotected final com.fs.starfarer.api.campaign.StarSystemAPI getStarSystem()
StarSystemAPI
.
StarSystemAPI
the player fleet is occupyingpublic java.lang.String getName()
protected final Console getConsole()
Console.getConsole()
.
Console.getConsole()
protected final com.fs.starfarer.api.combat.CombatEngineAPI getCombatEngine()
Console.getCombatEngine()
.
Console.getCombatEngine()
protected static <T> T getVar(java.lang.String varName, java.lang.Class<T> type)
Console.getVar(java.lang.String, java.lang.Class)
.
Console.getVar(java.lang.String, java.lang.Class)
protected static void setVar(java.lang.String varName, java.lang.Object varData)
Console.setVar(java.lang.String, java.lang.Object)
.
Console.setVar(java.lang.String, java.lang.Object)
protected static boolean hasVar(java.lang.String varName)
Console.hasVar(java.lang.String)
.
Console.hasVar(java.lang.String)
protected static java.lang.Class getVarType(java.lang.String varName)
Console.getVarType(java.lang.String)
.
Console.getVarType(java.lang.String)
protected static void showMessage(java.lang.String preamble, java.lang.String message, boolean indent)
Console.showMessage(java.lang.String, java.lang.String, boolean)
.
Console.showMessage(java.lang.String, java.lang.String, boolean)
protected static void showMessage(java.lang.String message)
Console.showMessage(java.lang.String)
.
Console.showMessage(java.lang.String)
protected static void showError(java.lang.String preamble, java.lang.Exception ex)
Console.showError(java.lang.String, java.lang.Exception)
.
Console.showError(java.lang.String, java.lang.Exception)
public final void showHelp()
getHelp()
.
public final void showSyntax()
getSyntax()
.
protected boolean isCombatOnly()
protected abstract java.lang.String getHelp()
showHelp()
.protected abstract java.lang.String getSyntax()
showSyntax()
.protected abstract boolean runCommand(java.lang.String args)
args
- the String
arguments passed by the Console
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |