org.haphazard.system.action
Class Controller

java.lang.Object
  extended byorg.haphazard.XML.MessageHandler
      extended byorg.haphazard.system.action.Action
          extended byorg.haphazard.system.action.CharacterAction
              extended byorg.haphazard.system.action.Controller

public class Controller
extends CharacterAction


Field Summary
 
Fields inherited from class org.haphazard.system.action.CharacterAction
ATTACK, CARRY, DEFEND, DIE, DROP, mCharacter, MOVE, mTarget, mWorld, NOTHING, SAY, WEAR
 
Fields inherited from class org.haphazard.system.action.Action
mController, mExecutionTime, mTimeStarted
 
Fields inherited from class org.haphazard.XML.MessageHandler
mMessageBuffer
 
Constructor Summary
Controller(Character character, Brain brain)
          Creates a new instance of Controller
 
Method Summary
 boolean perform()
          Performs the action
protected  boolean performAttack()
          Performs the attack
protected  boolean performCarry()
          Performs carry
protected  boolean performDeath()
          Performs death
protected  boolean performDefend()
           
protected  boolean performDrop()
          Performs drop
protected  boolean performMove()
          Performs the move action
protected  boolean performWear()
          Performs wear
 
Methods inherited from class org.haphazard.system.action.CharacterAction
attack, carry, defend, die, drop, getActionType, getCharacter, move, move, performSay, say, setCharacter, wear
 
Methods inherited from class org.haphazard.system.action.Action
equals, start
 
Methods inherited from class org.haphazard.XML.MessageHandler
addMessage, getNextMessage, hasMessage
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller(Character character,
                  Brain brain)
Creates a new instance of Controller

Parameters:
character - The character to control
brain - The brain to control it
Method Detail

perform

public boolean perform()
Description copied from class: CharacterAction
Performs the action

Overrides:
perform in class CharacterAction
Returns:
true if terminated for whatever reason

performMove

protected boolean performMove()
Description copied from class: CharacterAction
Performs the move action

Overrides:
performMove in class CharacterAction
Returns:
true if CharacterAction is terminated for whatever reason

performAttack

protected boolean performAttack()
Description copied from class: CharacterAction
Performs the attack

Overrides:
performAttack in class CharacterAction
Returns:
true if CharacterAction is terminated for whatever reason

performDefend

protected boolean performDefend()
Overrides:
performDefend in class CharacterAction

performDeath

protected boolean performDeath()
Description copied from class: CharacterAction
Performs death

Overrides:
performDeath in class CharacterAction
Returns:
true if the CharacterAction is terminated

performWear

protected boolean performWear()
Description copied from class: CharacterAction
Performs wear

Overrides:
performWear in class CharacterAction
Returns:
true if the CharacterAction is terminated

performCarry

protected boolean performCarry()
Description copied from class: CharacterAction
Performs carry

Overrides:
performCarry in class CharacterAction
Returns:
true if the CharacterAction is terminated

performDrop

protected boolean performDrop()
Description copied from class: CharacterAction
Performs drop

Overrides:
performDrop in class CharacterAction
Returns:
true if the CharacterAction is terminated