Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1.  
  2. /**
  3. * Write a description of class Item here.
  4. *
  5. * @author Thomas andré G. Petersson
  6. * @version 29.09.2016 | v0.1
  7. *
  8. * Item
  9.  
  10. */
  11. public class Item
  12. {
  13.  
  14. private String itemName;
  15. private String desc;
  16. private int value;
  17. private int weight;
  18. private String action;
  19.  
  20. public Item(String itemName, String desc, int value, int weight, String action)
  21. {
  22. this.itemName = itemName;
  23. this.desc = desc;
  24. this.value = value;
  25. this.weight = weight;
  26. this.action = action;
  27. }
  28. // Getters for bruk av arvings klasser #############################
  29. public String getName()
  30. {
  31. return itemName;
  32. }
  33.  
  34. public String getDesc()
  35. {
  36. return desc;
  37. }
  38.  
  39. public int getValue()
  40. {
  41. return value;
  42. }
  43.  
  44. public int getWeight()
  45. {
  46. return weight;
  47. }
  48.  
  49. public String getAction()
  50. {
  51. return action;
  52. }
  53. //##################################################################
  54.  
  55.  
  56. /**
  57. * Skriver ut informasjon om itemet.
  58. */
  59. public void print()
  60. {
  61. System.out.println("########################");
  62. System.out.println("# Name of item: " + itemName);
  63. System.out.println("# Item description: " + desc);
  64. System.out.println("# Item value: " + value + " coins");
  65. System.out.println("# Item weight: " + weight + "kg");
  66. System.out.println("########################");
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement