Thursday, May 3, 2018

More Class relations

Here is our interface

public interface I_items {
   public void addItem(Item i);
   public void removeItem(Item i);
}

Here is the code for a class that implements that interface

import java.util.ArrayList;

public class Inventory implements I_items{
  private ArrayList<Item> items;

@Override
public void addItem(Item i) {
 // TODO Auto-generated method stub
 
}

@Override
public void removeItem(Item i) {
 // TODO Auto-generated method stub
 
}
  
}

Here is the diagram for the card game program

Here is the link to the card game code on GitHub

No comments:

Post a Comment