public class DiscardController extends Controller implements IDiscardController, ModelObserver
| Modifier and Type | Field and Description | 
|---|---|
| private java.util.List<java.lang.Integer> | resourceList | 
| private IWaitView | waitView | 
| Constructor and Description | 
|---|
| DiscardController(IDiscardView view,
                 IWaitView waitView)DiscardController constructor | 
| Modifier and Type | Method and Description | 
|---|---|
| void | alert()Notifies an object that something has happened | 
| void | decreaseAmount(ResourceType resource)This method is called when the user decreases the amount of the specified
 resource. | 
| void | discard()This method is called when the user clicks the discard button. | 
| IDiscardView | getDiscardView() | 
| private int | getNumResourceCards() | 
| IWaitView | getWaitView() | 
| void | increaseAmount(ResourceType resource)This method is called when the user increases the amount of the specified
 resource. | 
| private void | initDiscardView() | 
| private void | initResourceList() | 
| private int | numResourcesPending() | 
| private void | updateDiscardStatus() | 
getViewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetViewprivate IWaitView waitView
private java.util.List<java.lang.Integer> resourceList
public DiscardController(IDiscardView view, IWaitView waitView)
view - View displayed to let the user select cards to discardwaitView - View displayed to notify the user that they are waiting for other players to discardpublic IDiscardView getDiscardView()
public IWaitView getWaitView()
public void increaseAmount(ResourceType resource)
IDiscardControllerincreaseAmount in interface IDiscardControllerresource - The resource that was increasedpublic void decreaseAmount(ResourceType resource)
IDiscardControllerdecreaseAmount in interface IDiscardControllerresource - The resource that was decreasedprivate int numResourcesPending()
private void updateDiscardStatus()
public void discard()
IDiscardControllerdiscard in interface IDiscardControllerpublic void alert()
ModelObserveralert in interface ModelObserverprivate void initDiscardView()
private int getNumResourceCards()
private void initResourceList()