ace

hero 5.0 :)

ace
May 2nd, 2010
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. import java.util.HashMap;
  2.  
  3. /**
  4. * Write a description of class Hero here.
  5. *
  6. * @author (your name)
  7. * @version (a version number or a date)
  8. */
  9. public class Hero
  10. {
  11. // instance variables - replace the example below with your own
  12.  
  13. private HashMap<String, Potion> potions;
  14. private HashMap<String, Scroll> scrolls;
  15. private HashMap <String, Spell> spells;
  16.  
  17. /**
  18. * Constructor for objects of class Hero
  19. */
  20. public Hero()
  21. {
  22. potions = new HashMap<String, Potion>();
  23. scrolls = new HashMap<String, Scroll>();
  24. spells = new HashMap <String, Spell>();
  25.  
  26. }
  27.  
  28. /**
  29. * An example of a method - replace this comment with your own
  30. *
  31. * @param y a sample parameter for a method
  32. * @return the sum of x and y
  33. */
  34. public void getPotion(String description)
  35. {
  36. Alchemist alchemist = new Alchemist();
  37. potions.put(description, alchemist.requestPotion(description));
  38.  
  39. }
  40.  
  41. public void getScroll(String description)
  42. {
  43. Scribe scribe = new Scribe();
  44. scrolls.put(description, scribe.requestScroll(description));
  45.  
  46. }
  47.  
  48.  
  49. public void getSpell(Potion potion, String description1, Scroll scroll, String description2)
  50. {
  51. potion = potions.get(description1);
  52. scroll = scrolls.get(description2);
  53.  
  54. }
  55.  
  56. public void getName(
  57.  
  58. }
Add Comment
Please, Sign In to add comment