zork2Class
Class Door

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

public class Door
extends java.lang.Object

the class Door creation :5 mai 03 at 17:52:24

Version:
1.0
Author:
Michel de VERDELHAN

Field Summary
static java.lang.String IMG_FRONT_DOOR_DEFAULT_PATH
          teh default north/south placed door image location on disk
static java.lang.String IMG_NEXT_DOOR_DEFAULT_PATH
          the default east/west placed door image location on disk
 
Constructor Summary
Door()
          default Constructor for Door.
Door(Room laPiece)
          Constructor for Door.
Door(java.lang.String laPiece)
          Constructor for Door.
 
Method Summary
 boolean CanBeOpen()
          Method CanBeOpen.
 void checkAndSetImgDoor(java.lang.String string)
          void Door::checkAndSetImgDoor
check the door location and set the valide default image for the door
 boolean doorIsOpen()
          Returns if the door is Open.
 Room getDestination()
          Returns the destination room.
 java.lang.String getDestinationName()
          Returns the destination room name.
 java.awt.Image getImgDoor()
          Returns the Door's image.
 java.lang.String getKey()
          Returns the door key.
 void setDestination(Room destination)
          Sets the destination room.
 void setDestinationName(java.lang.String destination)
          Sets the destination room name.
 void setImgDoor(java.awt.Image imgDoor)
          Sets the Door's image.
 void setImgDoor(java.lang.String imgDoor)
          Sets the Doors image location on disk.
 void setIsOpen(boolean isOpen)
          Sets if the door is Open.
 void setKey(java.lang.String key)
          Sets the item key name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMG_NEXT_DOOR_DEFAULT_PATH

public static final java.lang.String IMG_NEXT_DOOR_DEFAULT_PATH
the default east/west placed door image location on disk

See Also:
Constant Field Values

IMG_FRONT_DOOR_DEFAULT_PATH

public static final java.lang.String IMG_FRONT_DOOR_DEFAULT_PATH
teh default north/south placed door image location on disk

See Also:
Constant Field Values
Constructor Detail

Door

public Door()
default Constructor for Door.


Door

public Door(java.lang.String laPiece)
Constructor for Door.

Parameters:
laPiece - destination room's name

Door

public Door(Room laPiece)
Constructor for Door.

Parameters:
laPiece - destination room
Method Detail

CanBeOpen

public boolean CanBeOpen()
Method CanBeOpen.
if the door can't be open (if it is closed and haven't a key) this return false elsewhere this return true

Returns:
boolean saying if the door is "openable"

getDestinationName

public java.lang.String getDestinationName()
Returns the destination room name.

Returns:
String the destination room name

doorIsOpen

public boolean doorIsOpen()
Returns if the door is Open.

Returns:
boolean true if the door is open

getKey

public java.lang.String getKey()
Returns the door key.

Returns:
String the key representing the name of the key item

getDestination

public Room getDestination()
Returns the destination room.

Returns:
Room the destination

getImgDoor

public java.awt.Image getImgDoor()
Returns the Door's image.

Returns:
Image the door's image

setDestinationName

public void setDestinationName(java.lang.String destination)
Sets the destination room name.


setIsOpen

public void setIsOpen(boolean isOpen)
Sets if the door is Open.

Parameters:
isOpen - The value to set

setKey

public void setKey(java.lang.String key)
Sets the item key name.

Parameters:
key - The key to set

setDestination

public void setDestination(Room destination)
Sets the destination room.

Parameters:
destination - The destination room to set

setImgDoor

public void setImgDoor(java.awt.Image imgDoor)
Sets the Door's image.

Parameters:
imgDoor - The image to set

setImgDoor

public void setImgDoor(java.lang.String imgDoor)
Sets the Doors image location on disk.

Parameters:
imgDoor - The imgDoor Path which is used to set.

checkAndSetImgDoor

public void checkAndSetImgDoor(java.lang.String string)
void Door::checkAndSetImgDoor
check the door location and set the valide default image for the door

Parameters:
string -