⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 item.java

📁 Zuul经典Java迷宫游戏.但是只是实现基本行走,拾取,放下,和与npc交易.
💻 JAVA
字号:
/**
 * 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -