item.java
来自「Zuul经典Java迷宫游戏.但是只是实现基本行走,拾取,放下,和与npc交易.」· Java 代码 · 共 71 行
JAVA
71 行
/**
* This class is part of the "World of Zuul" application.
* "World of Zuul" is a very simple, text based adventure game.
*
* This Class include the attributes of item, here it includes
* item name, item descrtiption. And one method for seting
* Item, others for return a Item Name and Item description.
*
* @author Yuanxiao Li
*/
public class Item {
protected String description;
protected String name;
/**
* define an Item with attribute name and description
* @param name
* @param description
*/
public Item(String name, String description)
{
this.name = name;
this.description = description;
}
/**
* Add name and description to the item's attributes
*
* @param name
* @param description
public void setItem(String name, String description)
{
this.name = name;
this.description = description;
}
*/
/**
*
* @return an Item Name.
*/
public String getItemName()
{
return name;
}
/**
*
* @return an Item description
*/
public String getItemDescription()
{
return description;
}
public Item getNPCItem()
{
return new Item (name,description);
}
public void setItemName(String name)
{
this.name = name;
}
public void setItemDescription(String desc)
{
this.description = desc;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?