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() |
getView
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getView
private 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)
IDiscardController
increaseAmount
in interface IDiscardController
resource
- The resource that was increasedpublic void decreaseAmount(ResourceType resource)
IDiscardController
decreaseAmount
in interface IDiscardController
resource
- The resource that was decreasedprivate int numResourcesPending()
private void updateDiscardStatus()
public void discard()
IDiscardController
discard
in interface IDiscardController
public void alert()
ModelObserver
alert
in interface ModelObserver
private void initDiscardView()
private int getNumResourceCards()
private void initResourceList()