zork2Class
Class Chest

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

public class Chest
extends java.lang.Object

the class Chest creation :5 mai 03 at 17:51:42

Version:
1.0
Author:
Michel de VERDELHAN

Field Summary
static java.lang.String IMG_CLOSE_CHEST_DEFAULT_PATH
          the default chest's close image
static java.lang.String IMG_OPEN_CHEST_DEFAULT_PATH
          the default chest's open image
 
Constructor Summary
Chest()
          create a new chest whith default values
posX = 4
posY = 4
key = no_key
chest is open
open and close image are default images
 
Method Summary
 java.awt.Image getImgChestClose()
          Returns the chest Close image.
 java.awt.Image getImgChestOpen()
          Returns the Chest Open image.
 Item getItem()
          Returns the item contained in the chest.
 java.lang.String getKey()
          Returns the key which open the chest.
 int getPosX()
          Returns the chest posX.
 int getPosY()
          Returns the chest posY.
 boolean isOpen()
          return true if chest is open
 void setImgChestClose(java.awt.Image imgChestClose)
          Sets the Chest's Close image.
 void setImgChestClose(java.lang.String imgChestClose)
          Sets the Chest's Close image.
 void setImgChestOpen(java.awt.Image imgChestOpen)
          Sets the Chest's Open image.
 void setImgChestOpen(java.lang.String imgChestOpen)
          Sets the Chest's Open image.
 void setIsOpen(boolean isOpen)
          Sets if the chest is open.
 void setItem(Item item)
          Sets the chest's item.
 void setKey(java.lang.String key)
          Sets the key.
 void setPosX(int posX)
          Sets the chest's X position.
 void setPosY(int posY)
          Sets the chest Y position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMG_OPEN_CHEST_DEFAULT_PATH

public static java.lang.String IMG_OPEN_CHEST_DEFAULT_PATH
the default chest's open image


IMG_CLOSE_CHEST_DEFAULT_PATH

public static java.lang.String IMG_CLOSE_CHEST_DEFAULT_PATH
the default chest's close image

Constructor Detail

Chest

public Chest()
create a new chest whith default values
posX = 4
posY = 4
key = no_key
chest is open
open and close image are default images

Method Detail

isOpen

public boolean isOpen()
return true if chest is open

Returns:
boolean true if open, false if close

getItem

public Item getItem()
Returns the item contained in the chest.

Returns:
Item: the item contained in the chest

getKey

public java.lang.String getKey()
Returns the key which open the chest.

Returns:
a string representing the key item's name

getPosX

public int getPosX()
Returns the chest posX.

Returns:
the X position

getPosY

public int getPosY()
Returns the chest posY.

Returns:
the Y position

getImgChestClose

public java.awt.Image getImgChestClose()
Returns the chest Close image.

Returns:
the chest close image

getImgChestOpen

public java.awt.Image getImgChestOpen()
Returns the Chest Open image.

Returns:
the Chest Open image

setIsOpen

public void setIsOpen(boolean isOpen)
Sets if the chest is open.

Parameters:
isOpen - the value to set: true if chest is open, false is the chest is close

setItem

public void setItem(Item item)
Sets the chest's item.

Parameters:
item - The item to set

setKey

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

Parameters:
key - The key to set

setPosX

public void setPosX(int posX)
Sets the chest's X position.

Parameters:
posX - The X position to set

setPosY

public void setPosY(int posY)
Sets the chest Y position.

Parameters:
posY - The Y position to set

setImgChestClose

public void setImgChestClose(java.awt.Image imgChestClose)
Sets the Chest's Close image.

Parameters:
imgChestClose - The Chest's Close image to set

setImgChestClose

public void setImgChestClose(java.lang.String imgChestClose)
Sets the Chest's Close image.

Parameters:
imgChestClose - a string representing the image location on disk

setImgChestOpen

public void setImgChestOpen(java.lang.String imgChestOpen)
Sets the Chest's Open image.

Parameters:
imgChestOpen - a string representing the image location on disk

setImgChestOpen

public void setImgChestOpen(java.awt.Image imgChestOpen)
Sets the Chest's Open image.

Parameters:
imgChestOpen - The Chest's Open image to set