
hero 5.0 :)
By:
ace on
May 2nd, 2010 | syntax:
None | size: 1.33 KB | hits: 25 | expires: Never
import java.util.HashMap;
/**
* Write a description of class Hero here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Hero
{
// instance variables - replace the example below with your own
private HashMap<String, Potion> potions;
private HashMap<String, Scroll> scrolls;
private HashMap <String, Spell> spells;
/**
* Constructor for objects of class Hero
*/
public Hero()
{
potions = new HashMap<String, Potion>();
scrolls = new HashMap<String, Scroll>();
spells = new HashMap <String, Spell>();
}
/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
public void getPotion(String description)
{
Alchemist alchemist = new Alchemist();
potions.put(description, alchemist.requestPotion(description));
}
public void getScroll(String description)
{
Scribe scribe = new Scribe();
scrolls.put(description, scribe.requestScroll(description));
}
public void getSpell(Potion potion, String description1, Scroll scroll, String description2)
{
potion = potions.get(description1);
scroll = scrolls.get(description2);
}
public void getName(
}