Class Tutorial

java.lang.Object
  |
  +--java.util.Observable
        |
        +--Map
              |
              +--Tutorial

public class Tutorial
extends Map

The Tutorial is an illustration of how Sokoban is to be played.

The format for a tutorial step file is:
[Description]
This is a step description.
[Move]
UP
DOWN
LEFT
RIGHT


Fields inherited from class Map
level, loading, robots
 
Constructor Summary
Tutorial(Game owner)
          Initializes the tutorial and loads the first step.
 
Method Summary
 int getCurrentStep()
          Returns the number of the current step.
 java.lang.String[] getDescription()
          Returns an array of Strings describing the current step.
 void getLastStep()
          Sets the current step to the previous step and then calls loadStep.
 void getNextStep()
          Sets the current step to the next step and then calls loadStep.
 void loadStep()
          Loads the current step's description and moves.
 void showStep()
          Calls the instantReplay() method and then saves the board to the tempLevel file.
 
Methods inherited from class Map
addRobot, calculateScore, changeLevel, getMap, getRobot, getRobots, getTime, instantReplay, isPaused, moveRobot, pauseTimer, removeRobot, restartLevel, setTimer, startTimer, toStringArray, undoMove
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tutorial

public Tutorial(Game owner)
Initializes the tutorial and loads the first step.
Method Detail

loadStep

public void loadStep()

Loads the current step's description and moves.

Pre-condition:none
Post-condition:description is loaded into the description vector and the moves are loaded onto the moveTracker

showStep

public void showStep()

Calls the instantReplay() method and then saves the board to the tempLevel file.

Pre-condition:a tutorial step has been loaded
Post-condition:the current step has been shown and the tempLevel file has been stored

getNextStep

public void getNextStep()
Sets the current step to the next step and then calls loadStep. Pre-condition:none
Post-condition:the next step has been loaded

getLastStep

public void getLastStep()
Sets the current step to the previous step and then calls loadStep.
Pre-condition:none

Post-condition:the previous step has been loaded

getDescription

public java.lang.String[] getDescription()
Returns an array of Strings describing the current step.
Returns:
a String array containing the description of the current step

getCurrentStep

public int getCurrentStep()
Returns the number of the current step.
Returns:
the number of the current step