juyt66

Untitled

Nov 19th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. package com.vignesh.learnjava;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. /**
  6.  * Created by vignesh on 10-11-2016.
  7.  */
  8.  
  9. public class Demo {
  10.  
  11.     public static void main(String[] args) {
  12.         Player tim = new Player();
  13.         //System.out.println(tim.handleName);
  14.         tim.setHandleName("tim");
  15.        // System.out.println(tim.getHandleName());
  16.  
  17.         Player louise = new Player("lousie");
  18.         System.out.println(louise.getHandleName());
  19.  
  20.         System.out.println(tim.getWeapon().getName());
  21.         InventoryItem redPotion = new InventoryItem(itemType.POTION,"Red Potion");
  22.  
  23.        tim.addInventoryItem(redPotion);
  24.         ArrayList<InventoryItem> allItems = tim.getInventoryItems();
  25.         for(InventoryItem item : allItems){
  26.             System.out.println(item.getName());
  27.         }
  28.     }
  29.  
  30. }
Add Comment
Please, Sign In to add comment