zork2Class
Class Room

java.lang.Object
  |
  +--zork2Class.Room

public class Room
extends java.lang.Object

classe : Room.java This class room contains all room attribut. A room is a place where the player can walk. He can find chest an Item in a room. Each wall has is image. It the same for the floor.

Author:
de VERDELHAN Michel, BOYERE Fabien

Field Summary
static java.lang.String IMG_FLOOR_DEFAULT
           
static java.lang.String IMG_WALL_FRONT_DEFAULT
           
static java.lang.String IMG_WALL_NEXT_DEFAULT
           
 
Constructor Summary
Room()
          the default constructeur for room
Room(java.lang.String name, java.lang.String description)
          Create a room with a name and a description
 
Method Summary
 boolean canGoToPosition(int posX, int posY)
          canGoToPosition check if there is a chest at Xposition, and Y position you choice and return true if the player could go to position
 void centerPlayer(Player joueur)
          method :void centerPlayer
 int countDoor()
          method :int countDoor
return the number of door
 boolean eastDoorExist()
          eastDoorExist return a boolean attribut which permit to know if there is a east door in this room.
 Chest getChest()
          This method return the chest which is on the room.
 java.lang.String getDescription()
          Returns the Description of the current room.
 Door getDoorEast()
          Returns the doorEast.
 Door getDoorNorth()
          Returns the doorNorth.
 Door getDoorSouth()
          Returns the doorSouth.
 Door getDoorWest()
          Returns the doorWest.
 java.awt.Image getImgBackWall()
          The imgBackWall is the image of the back wall which is display in the game Screen.
 java.awt.Image getImgFloor()
          The imgFloor is the image of the floor which is display in the game Screen.
 java.awt.Image getImgFrontWall()
          The imgFrontWall is the image of the front wall which is display in the game Screen.
 java.awt.Image getImgLeftWall()
          The imgLeftWall is the image of the left wall which is display in the game Screen.
 java.awt.Image getImgRightWall()
          The imgRightWall is the image of the right wall which is display in the game Screen.
 Item[][] getItemPosition()
          Returns the itemPosition.
 Item getItemPosition(int x, int y)
          Returns the itemPosition.
 java.lang.String getName()
          Returns the Name of the room which is selected.
 Ordeal getOrdeal()
          Returns the ordeal.
 boolean haveDoor()
          This method check if there are at less one door in the room, and return true if there are at less one door
 boolean isItemOnPosition(int posX, int posY)
          isItemOnPosition check if there is an item at X position, and Y position you have choose and return true if there are Item to position
 boolean isOrdealActivate()
          Returns the isOrdealSuccess.
 boolean isVisited()
          Returns the isVisited.
 boolean northDoorExist()
          northDoorExist return a boolean attribut which permit to know if there is a north door in this room.
 void setChest(Chest chest)
          Sets the chest.
 void setDoorEast(Door doorEast)
          Sets the doorEast.
 void setDoorNorth(Door doorNorth)
          Sets the doorNorth.
 void setDoorSouth(Door doorSouth)
          Sets the doorSouth.
 void setDoorWest(Door doorWest)
          Sets the doorWest.
 void setImgBackWall(java.awt.Image imgBackWall)
          Sets the imgBackWall.
 void setImgBackWall(java.lang.String imgBackWallPath)
          Sets the imgBackWallPath.
 void setImgFloor(java.awt.Image imgFloor)
          Sets the imgFloor.
 void setImgFloor(java.lang.String imgFloorPath)
          Sets the imgFloorPath.
 void setImgFrontWall(java.awt.Image imgFrontWall)
          Sets the imgFrontWall.
 void setImgFrontWall(java.lang.String imgFrontWallPath)
          Sets the imgFrontWallPath.
 void setImgLeftWall(java.awt.Image imgLeftWall)
          Sets the imgLeftWall.
 void setImgLeftWall(java.lang.String imgLeftWallPath)
          Sets the imgLeftWallPath.
 void setImgRightWall(java.awt.Image imgRightWall)
          Sets the imgRightWall.
 void setImgRightWall(java.lang.String imgRightWallPath)
          Sets the imgRightWallPath.
 void setIsOrdealActivate(boolean isOrdealActivate)
          Sets the isOrdealSuccess.
 void setIsVisited(boolean isVisited)
          Sets the isVisited.
 void setItemPosition(Item[][] items)
          set an array of items in the room
 void setItemPosition(Item item, int posX, int posY)
          Sets the itemPosition.
 void setOrdeal(Ordeal ordeal)
          Sets the ordeal.
 void setRoomDescription(java.lang.String roomDescription)
          Sets the roomDescription.
 void setRoomName(java.lang.String name)
          Sets the roomName.
 boolean southDoorExist()
          southDoorExist return a boolean attribut which permit to know if there is a south door in this room.
 boolean westDoorExist()
          westDoorExist return a boolean attribut which permit to know if there is a west door in this room.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMG_WALL_FRONT_DEFAULT

public static final java.lang.String IMG_WALL_FRONT_DEFAULT
See Also:
Constant Field Values

IMG_WALL_NEXT_DEFAULT

public static final java.lang.String IMG_WALL_NEXT_DEFAULT
See Also:
Constant Field Values

IMG_FLOOR_DEFAULT

public static final java.lang.String IMG_FLOOR_DEFAULT
See Also:
Constant Field Values
Constructor Detail

Room

public Room()
the default constructeur for room


Room

public Room(java.lang.String name,
            java.lang.String description)
Create a room with a name and a description

Parameters:
name - th room's name
description - the room's description
Method Detail

westDoorExist

public boolean westDoorExist()
westDoorExist return a boolean attribut which permit to know if there is a west door in this room. Return true if the west door exist and false, if the door does not exist.

Returns:
boolean

eastDoorExist

public boolean eastDoorExist()
eastDoorExist return a boolean attribut which permit to know if there is a east door in this room. Return true if the east door exist and false, if the east door does not exist.

Returns:
boolean

southDoorExist

public boolean southDoorExist()
southDoorExist return a boolean attribut which permit to know if there is a south door in this room. Return true if the south door exist and false, if the door does not exist.

Returns:
boolean

northDoorExist

public boolean northDoorExist()
northDoorExist return a boolean attribut which permit to know if there is a north door in this room. Return true if the north door exist and false, if the north door does not exist.

Returns:
boolean

haveDoor

public boolean haveDoor()
This method check if there are at less one door in the room, and return true if there are at less one door

Returns:
boolean

canGoToPosition

public boolean canGoToPosition(int posX,
                               int posY)
canGoToPosition check if there is a chest at Xposition, and Y position you choice and return true if the player could go to position

Parameters:
posX - : the X position we d'like to check
posY - : the Y position we d'like to check
Returns:
boolean

isItemOnPosition

public boolean isItemOnPosition(int posX,
                                int posY)
isItemOnPosition check if there is an item at X position, and Y position you have choose and return true if there are Item to position

Parameters:
posX - : the X position we d'like to check
posY - : the Y position we d'like to check
Returns:
boolean

centerPlayer

public void centerPlayer(Player joueur)
method :void centerPlayer

Parameters:
joueur -

countDoor

public int countDoor()
method :int countDoor
return the number of door

Returns:
the number of door

isVisited

public boolean isVisited()
Returns the isVisited.

Returns:
boolean

getChest

public Chest getChest()
This method return the chest which is on the room.

Returns:
Chest

getDoorEast

public Door getDoorEast()
Returns the doorEast.

Returns:
Door

getDoorNorth

public Door getDoorNorth()
Returns the doorNorth.

Returns:
Door

getDoorSouth

public Door getDoorSouth()
Returns the doorSouth.

Returns:
Door

getDoorWest

public Door getDoorWest()
Returns the doorWest.

Returns:
Door

getImgBackWall

public java.awt.Image getImgBackWall()
The imgBackWall is the image of the back wall which is display in the game Screen. This method return an image to display it.

Returns:
Image

getImgFloor

public java.awt.Image getImgFloor()
The imgFloor is the image of the floor which is display in the game Screen. This method return an image to display it.

Returns:
Image

getImgFrontWall

public java.awt.Image getImgFrontWall()
The imgFrontWall is the image of the front wall which is display in the game Screen. This method return an image to display it.

Returns:
Image

getImgLeftWall

public java.awt.Image getImgLeftWall()
The imgLeftWall is the image of the left wall which is display in the game Screen. This method return an image to display it.

Returns:
Image

getImgRightWall

public java.awt.Image getImgRightWall()
The imgRightWall is the image of the right wall which is display in the game Screen. This method return an image to display it.

Returns:
Image

getItemPosition

public Item[][] getItemPosition()
Returns the itemPosition.

Returns:
String[][]

getItemPosition

public Item getItemPosition(int x,
                            int y)
Returns the itemPosition.

Returns:
String[][]

getOrdeal

public Ordeal getOrdeal()
Returns the ordeal.

Returns:
String

isOrdealActivate

public boolean isOrdealActivate()
Returns the isOrdealSuccess.

Returns:
boolean

getDescription

public java.lang.String getDescription()
Returns the Description of the current room.

Returns:
String

getName

public java.lang.String getName()
Returns the Name of the room which is selected.

Returns:
String

setChest

public void setChest(Chest chest)
Sets the chest.

Parameters:
chest - The chest to set

setDoorEast

public void setDoorEast(Door doorEast)
Sets the doorEast.

Parameters:
doorEast - The doorEast to set

setDoorNorth

public void setDoorNorth(Door doorNorth)
Sets the doorNorth.

Parameters:
doorNorth - The doorNorth to set

setDoorSouth

public void setDoorSouth(Door doorSouth)
Sets the doorSouth.

Parameters:
doorSouth - The doorSouth to set

setDoorWest

public void setDoorWest(Door doorWest)
Sets the doorWest.

Parameters:
doorWest - The doorWest to set

setImgBackWall

public void setImgBackWall(java.lang.String imgBackWallPath)
Sets the imgBackWallPath.

Parameters:
imgBackWallPath - The imgBackWallPath to set

setImgFloor

public void setImgFloor(java.lang.String imgFloorPath)
Sets the imgFloorPath.

Parameters:
imgFloorPath - The imgFloorPath to set

setImgFrontWall

public void setImgFrontWall(java.lang.String imgFrontWallPath)
Sets the imgFrontWallPath.

Parameters:
imgFrontWallPath - The imgFrontWallPath to set

setImgLeftWall

public void setImgLeftWall(java.lang.String imgLeftWallPath)
Sets the imgLeftWallPath.

Parameters:
imgLeftWallPath - The imgLeftWallPath to set

setImgRightWall

public void setImgRightWall(java.lang.String imgRightWallPath)
Sets the imgRightWallPath.

Parameters:
imgRightWallPath - The imgRightWallPath to set

setItemPosition

public void setItemPosition(Item item,
                            int posX,
                            int posY)
Sets the itemPosition.


setOrdeal

public void setOrdeal(Ordeal ordeal)
Sets the ordeal.

Parameters:
ordeal - The ordeal to set

setRoomDescription

public void setRoomDescription(java.lang.String roomDescription)
Sets the roomDescription.

Parameters:
roomDescription - The roomDescription to set

setRoomName

public void setRoomName(java.lang.String name)
Sets the roomName.


setImgBackWall

public void setImgBackWall(java.awt.Image imgBackWall)
Sets the imgBackWall.

Parameters:
imgBackWall - The imgBackWall to set

setImgFloor

public void setImgFloor(java.awt.Image imgFloor)
Sets the imgFloor.

Parameters:
imgFloor - The imgFloor to set

setImgFrontWall

public void setImgFrontWall(java.awt.Image imgFrontWall)
Sets the imgFrontWall.

Parameters:
imgFrontWall - The imgFrontWall to set

setImgLeftWall

public void setImgLeftWall(java.awt.Image imgLeftWall)
Sets the imgLeftWall.

Parameters:
imgLeftWall - The imgLeftWall to set

setImgRightWall

public void setImgRightWall(java.awt.Image imgRightWall)
Sets the imgRightWall.

Parameters:
imgRightWall - The imgRightWall to set

setIsOrdealActivate

public void setIsOrdealActivate(boolean isOrdealActivate)
Sets the isOrdealSuccess.


setIsVisited

public void setIsVisited(boolean isVisited)
Sets the isVisited.

Parameters:
isVisited - The isVisited to set

setItemPosition

public void setItemPosition(Item[][] items)
set an array of items in the room

Parameters:
items -