jplay
Class Scene

java.lang.Object
  extended by jplay.Scene

public class Scene
extends java.lang.Object

Class responsible for handling a Scenario.


Constructor Summary
Scene()
           
 
Method Summary
 void addOverlay(GameObject overlay)
          Adds a overlay scene.
 void changeTile(int row, int colunm, int newID)
          Changes the id tile storage in the matrix.
 void draw()
          Draws the scene on the screen.
 TileInfo getTile(int row, int colunm)
          Returns the file info stored in the row and column position of matrix.
 java.util.Vector getTilesFromRect(java.awt.Point min, java.awt.Point max)
          Returns the Tiles below the area bounded by max and min points.
 void loadFromFile(java.lang.String sceneFile)
          Loads a scene from a file.
 void removeTile(int row, int colunm)
          Removes a tile from the matrix.
 void saveToFile(java.lang.String fileName)
          Save the current state of the scene in a new file.
 void setDrawStartPos(int drawStartX, int drawStartY)
          Sets the initial X and Y position will be used to draw the scene.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scene

public Scene()
Method Detail

loadFromFile

public void loadFromFile(java.lang.String sceneFile)
Loads a scene from a file.

Parameters:
sceneFile - File path.

addOverlay

public void addOverlay(GameObject overlay)
Adds a overlay scene.

Parameters:
overlay - Any GameObject.

setDrawStartPos

public void setDrawStartPos(int drawStartX,
                            int drawStartY)
Sets the initial X and Y position will be used to draw the scene.

Parameters:
drawStartX -
drawStartY -

draw

public void draw()
Draws the scene on the screen.


getTile

public TileInfo getTile(int row,
                        int colunm)
Returns the file info stored in the row and column position of matrix.

Parameters:
row - Row in the matrix.
colunm - Column in the matrix.
Returns:
TileInfo

getTilesFromRect

public java.util.Vector getTilesFromRect(java.awt.Point min,
                                         java.awt.Point max)
Returns the Tiles below the area bounded by max and min points.

Parameters:
min - Upper left corner point of the area.
max - Lower right point of the area.
Returns:
Vector

removeTile

public void removeTile(int row,
                       int colunm)
Removes a tile from the matrix.

Parameters:
row -
colunm -

changeTile

public void changeTile(int row,
                       int colunm,
                       int newID)
Changes the id tile storage in the matrix.

Parameters:
row - Row of the matrix.
colunm - Colunm of the matrix.
newID - New code which will replace the old Id represented for the row and column.

saveToFile

public void saveToFile(java.lang.String fileName)
Save the current state of the scene in a new file.

Parameters:
fileName - Path of the file to save the scene.