net.sourceforge.worldsaver.rp
Class Adventure

java.lang.Object
  |
  +--net.sourceforge.worldsaver.rp.RpBase
        |
        +--net.sourceforge.worldsaver.rp.Action
              |
              +--net.sourceforge.worldsaver.rp.Adventure
All Implemented Interfaces:
MiscUtils, Saveable

public class Adventure
extends Action
implements Saveable, MiscUtils

This class implements an adventure.

Version:
Feb 11 2001
Author:
Andreas Schmitz
See Also:
Action, RpBase

Fields inherited from interface net.sourceforge.worldsaver.util.MiscUtils
CONSOLE_WIDTH, NEWLINE, RANDOM
 
Constructor Summary
Adventure(java.util.HashMap loaded)
          Constructs a new adventure from loaded data.
Adventure(RpBase father, java.lang.String name)
          The standard constructor.
 
Method Summary
 RpBase copy(boolean childs, boolean full)
          Returns a copy of this Adventure.
 void createActionTree(ActionParticle p)
          Creates a new ActionTree.
 void execute()
          Prepares the adventure for execution.
 void getReferencesRight(java.util.HashMap pool, IDGenerator gen)
          Gets the references right after loading.
 java.lang.String getSaveableString()
          Returns a saveable String.
 boolean isRunnable()
          Returns whether the action is runnable.
 void step(int index)
          Makes a step in the adventure.
 
Methods inherited from class net.sourceforge.worldsaver.rp.Action
getActionTree, getDecisionMessage, getLocation, getStartLocation, getText, isRunning, setStartLocation
 
Methods inherited from class net.sourceforge.worldsaver.rp.RpBase
addChild, addDescription, getChilds, getDescription, getFather, getID, getName, setDescription, setFather, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Adventure

public Adventure(RpBase father,
                 java.lang.String name)
The standard constructor.
Parameters:
father - the father
name - the name
See Also:
RpBase.RpBase(net.sourceforge.worldsaver.rp.RpBase, java.lang.String), Action.Action(net.sourceforge.worldsaver.rp.RpBase, java.lang.String)

Adventure

public Adventure(java.util.HashMap loaded)
Constructs a new adventure from loaded data.
Parameters:
loaded - the loaded values
See Also:
RpBase.RpBase(net.sourceforge.worldsaver.rp.RpBase, java.lang.String), Loader
Method Detail

getReferencesRight

public void getReferencesRight(java.util.HashMap pool,
                               IDGenerator gen)
Gets the references right after loading.
Specified by:
getReferencesRight in interface Saveable
Overrides:
getReferencesRight in class Action
Parameters:
pool - all objects
gen - the id-Generator
See Also:
RpBase.getReferencesRight(java.util.HashMap, net.sourceforge.worldsaver.util.IDGenerator)

getSaveableString

public java.lang.String getSaveableString()
                                   throws java.io.IOException
Returns a saveable String.
Specified by:
getSaveableString in interface Saveable
Overrides:
getSaveableString in class Action
Returns:
the String
Throws:
java.io.IOException - if objects are not valid
See Also:
RpBase.getSaveableString(), Saveable

execute

public void execute()
Prepares the adventure for execution.
Overrides:
execute in class Action
See Also:
Action.execute()

step

public void step(int index)
Makes a step in the adventure.
Overrides:
step in class Action
Parameters:
index - the index of the chosen step
See Also:
Action.step(int)

isRunnable

public boolean isRunnable()
Returns whether the action is runnable.
Overrides:
isRunnable in class Action
Returns:
true if runnable
See Also:
Action.isRunnable()

createActionTree

public void createActionTree(ActionParticle p)
Creates a new ActionTree.
Overrides:
createActionTree in class Action
Parameters:
p - the top of the action tree
See Also:
Action.createActionTree(net.sourceforge.worldsaver.rp.ActionParticle)

copy

public RpBase copy(boolean childs,
                   boolean full)
Returns a copy of this Adventure.
Overrides:
copy in class RpBase
Parameters:
childs - whether the childs should be copied, too
full - whether the childs of the childs should be copied, too, etc.