|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--zork2Class.Room
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.
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 |
public static final java.lang.String IMG_WALL_FRONT_DEFAULT
public static final java.lang.String IMG_WALL_NEXT_DEFAULT
public static final java.lang.String IMG_FLOOR_DEFAULT
Constructor Detail |
public Room()
public Room(java.lang.String name, java.lang.String description)
name
- th room's namedescription
- the room's descriptionMethod Detail |
public boolean westDoorExist()
true
if the west door exist
and false
, if the door does not exist.
public boolean eastDoorExist()
true
if the east door exist
and false
, if the east door does not exist.
public boolean southDoorExist()
true
if the south door exist
and false
, if the door does not exist.
public boolean northDoorExist()
true
if the north door exist
and false
, if the north door does not exist.
public boolean haveDoor()
public boolean canGoToPosition(int posX, int posY)
true
if the player could go to position
posX
- : the X position we d'like to checkposY
- : the Y position we d'like to check
public boolean isItemOnPosition(int posX, int posY)
true
if there are Item to position
posX
- : the X position we d'like to checkposY
- : the Y position we d'like to check
public void centerPlayer(Player joueur)
joueur
- public int countDoor()
public boolean isVisited()
public Chest getChest()
public Door getDoorEast()
public Door getDoorNorth()
public Door getDoorSouth()
public Door getDoorWest()
public java.awt.Image getImgBackWall()
public java.awt.Image getImgFloor()
public java.awt.Image getImgFrontWall()
public java.awt.Image getImgLeftWall()
public java.awt.Image getImgRightWall()
public Item[][] getItemPosition()
public Item getItemPosition(int x, int y)
public Ordeal getOrdeal()
public boolean isOrdealActivate()
public java.lang.String getDescription()
public java.lang.String getName()
public void setChest(Chest chest)
chest
- The chest to setpublic void setDoorEast(Door doorEast)
doorEast
- The doorEast to setpublic void setDoorNorth(Door doorNorth)
doorNorth
- The doorNorth to setpublic void setDoorSouth(Door doorSouth)
doorSouth
- The doorSouth to setpublic void setDoorWest(Door doorWest)
doorWest
- The doorWest to setpublic void setImgBackWall(java.lang.String imgBackWallPath)
imgBackWallPath
- The imgBackWallPath to setpublic void setImgFloor(java.lang.String imgFloorPath)
imgFloorPath
- The imgFloorPath to setpublic void setImgFrontWall(java.lang.String imgFrontWallPath)
imgFrontWallPath
- The imgFrontWallPath to setpublic void setImgLeftWall(java.lang.String imgLeftWallPath)
imgLeftWallPath
- The imgLeftWallPath to setpublic void setImgRightWall(java.lang.String imgRightWallPath)
imgRightWallPath
- The imgRightWallPath to setpublic void setItemPosition(Item item, int posX, int posY)
public void setOrdeal(Ordeal ordeal)
ordeal
- The ordeal to setpublic void setRoomDescription(java.lang.String roomDescription)
roomDescription
- The roomDescription to setpublic void setRoomName(java.lang.String name)
public void setImgBackWall(java.awt.Image imgBackWall)
imgBackWall
- The imgBackWall to setpublic void setImgFloor(java.awt.Image imgFloor)
imgFloor
- The imgFloor to setpublic void setImgFrontWall(java.awt.Image imgFrontWall)
imgFrontWall
- The imgFrontWall to setpublic void setImgLeftWall(java.awt.Image imgLeftWall)
imgLeftWall
- The imgLeftWall to setpublic void setImgRightWall(java.awt.Image imgRightWall)
imgRightWall
- The imgRightWall to setpublic void setIsOrdealActivate(boolean isOrdealActivate)
public void setIsVisited(boolean isVisited)
isVisited
- The isVisited to setpublic void setItemPosition(Item[][] items)
items
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |