Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class Item here.
- *
- * @author Thomas andré G. Petersson
- * @version 29.09.2016 | v0.1
- *
- * Item
- */
- public class Item
- {
- private String itemName;
- private String desc;
- private int value;
- private int weight;
- private String action;
- public Item(String itemName, String desc, int value, int weight, String action)
- {
- this.itemName = itemName;
- this.desc = desc;
- this.value = value;
- this.weight = weight;
- this.action = action;
- }
- // Getters for bruk av arvings klasser #############################
- public String getName()
- {
- return itemName;
- }
- public String getDesc()
- {
- return desc;
- }
- public int getValue()
- {
- return value;
- }
- public int getWeight()
- {
- return weight;
- }
- public String getAction()
- {
- return action;
- }
- //##################################################################
- /**
- * Skriver ut informasjon om itemet.
- */
- public void print()
- {
- System.out.println("########################");
- System.out.println("# Name of item: " + itemName);
- System.out.println("# Item description: " + desc);
- System.out.println("# Item value: " + value + " coins");
- System.out.println("# Item weight: " + weight + "kg");
- System.out.println("########################");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement