be.madoka.aardbei.sokoban
Class Logic

java.lang.Object
  |
  +--be.madoka.aardbei.sokoban.Logic
Direct Known Subclasses:
SokoLogic

public abstract class Logic
extends java.lang.Object

Represents the logic of a game.

Author:
Tim Van Wassenhove

Constructor Summary
Logic()
          Default constructor.
 
Method Summary
 void addVisualisation(Visualisation vis)
          Adds the given Visualisation to the visualisations.
abstract  boolean end()
          Ends the game.
abstract  java.lang.String getInfo()
          Gives some info about this game.
abstract  java.lang.String getName()
          Gives the name of this game.
abstract  boolean move(int direction)
          Moves the game in the given direction.
 void removeVisualisation(Visualisation vis)
          Removes the given Visualisation from the visualisations.
abstract  boolean start(java.lang.String playerName, java.lang.String fileName)
          Starts a new game from the given fileName for the given playerName.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logic

public Logic()
Default constructor.

Method Detail

addVisualisation

public void addVisualisation(Visualisation vis)
Adds the given Visualisation to the visualisations.

Parameters:
vis - the Visualisation

removeVisualisation

public void removeVisualisation(Visualisation vis)
Removes the given Visualisation from the visualisations.

Parameters:
vis - the Visualisation

getName

public abstract java.lang.String getName()
Gives the name of this game.

Returns:
a String specifying the name

getInfo

public abstract java.lang.String getInfo()
Gives some info about this game.

Returns:
a String giving info about this game

move

public abstract boolean move(int direction)
Moves the game in the given direction.

Parameters:
direction - the direction
Returns:
a boolean specifying if the move was performed or not

start

public abstract boolean start(java.lang.String playerName,
                              java.lang.String fileName)
Starts a new game from the given fileName for the given playerName.

Parameters:
playerName - the playerName
fileName - the filename
Returns:
a boolean specifying whether the game was started or not

end

public abstract boolean end()
Ends the game.

Returns:
a boolean specifying whether the game wa stopped or not