Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

burningbox.org.dsh.commands
Class AbCommand  view AbCommand download AbCommand.java

java.lang.Object
  extended byburningbox.org.dsh.commands.AbstractCommand
      extended byburningbox.org.dsh.commands.UndoableAbstractCommand
          extended byburningbox.org.dsh.commands.AbCommand
All Implemented Interfaces:
CombatCommand, RegularCommand

public class AbCommand
extends UndoableAbstractCommand
implements RegularCommand, CombatCommand

Adds or remove hit points to a monster or a character. min is then -10 (death) and max is the max hit points.

CVS Info :
$Author: jmettraux $
$Date: 2002/06/26 15:00:57 $
$Id: AbCommand.java,v 1.3 2002/06/26 15:00:57 jmettraux Exp $


Field Summary
protected  java.lang.String abilityDefinition
           
protected  int delta
           
protected  java.lang.String targetName
           
 
Fields inherited from class burningbox.org.dsh.commands.AbstractCommand
commandLine, originalCommandLine, tokenizer
 
Constructor Summary
AbCommand()
           
 
Method Summary
 boolean execute()
          This method is called when the command is executed.
 java.lang.String getHelp()
          as the name implies
 java.lang.String getSyntax()
          as the name implies
 java.lang.String getUndoInfo()
          A one-line info about the consequences of any undo
private static boolean incrementHitPoints(java.lang.String targetName, int hpCount)
           
private  boolean isAbilityDefinitionOk()
           
 boolean modifyAbility(int delta)
           
 void undo()
          This method is called to undo a command.
 
Methods inherited from class burningbox.org.dsh.commands.AbstractCommand
getTokenizer, noMoreTokens, setCommandLine, setOriginalCommandLine, setTokenizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetName

protected java.lang.String targetName

abilityDefinition

protected java.lang.String abilityDefinition

delta

protected int delta
Constructor Detail

AbCommand

public AbCommand()
Method Detail

incrementHitPoints

private static boolean incrementHitPoints(java.lang.String targetName,
                                          int hpCount)

modifyAbility

public boolean modifyAbility(int delta)

isAbilityDefinitionOk

private boolean isAbilityDefinitionOk()

execute

public boolean execute()
Description copied from class: AbstractCommand
This method is called when the command is executed.

Specified by:
execute in class AbstractCommand

getUndoInfo

public java.lang.String getUndoInfo()
Description copied from class: UndoableAbstractCommand
A one-line info about the consequences of any undo

Specified by:
getUndoInfo in class UndoableAbstractCommand

undo

public void undo()
Description copied from class: UndoableAbstractCommand
This method is called to undo a command.

Specified by:
undo in class UndoableAbstractCommand

getSyntax

public java.lang.String getSyntax()
Description copied from class: AbstractCommand
as the name implies

Specified by:
getSyntax in class AbstractCommand

getHelp

public java.lang.String getHelp()
Description copied from class: AbstractCommand
as the name implies

Specified by:
getHelp in class AbstractCommand