discard.DiscardView Class
A view for discarding cards. Inherits from misc.BaseOverlay.
Constructor
discard.DiscardView
()
Item Index
Methods
closeModal
()
makes the overlay invisible
Returns:
void
setController
-
controller
Attaches the controller to the view and builds the view on the page.
Parameters:
-
controller
discard.Controller
Returns:
void
setDiscardButtonEnabled
-
shouldEnable
Enables or disabled the discard button.
Parameters:
-
shouldEnable
Booleanwhether or not a player can discard yet
Returns:
void
setResourceAmount
-
resource
-
amount
Sets the amount displayed for a single resource.
Parameters:
-
resource
Stringthe resource to discard (see catan.definitions.ResourceTypes)
-
amount
Intthe current amount to display
Returns:
void
setResourceAmountChangeEnabled
-
resource
-
increase
-
decrease
Enables/disables increasing or decreasing for a single resource.
Parameters:
-
resource
Stringthe resource to discard (see catan.definitions.ResourceTypes)
-
increase
Booleanwhether you can increase the amount displayed
-
decrease
Booleanwhether you can decrease the amount displayed
Returns:
void
setResourceMaxAmount
-
resource
-
amt
Sets the maximum amount of a resource that the player can discard
Parameters:
-
resource
Stringthe resource to discard (see catan.definitions.ResourceTypes)
-
amt
Intthe max amount you can discard of the resource
Returns:
void
setStateMessage
-
message
Sets the state message, which indicates how many cards a player has set to discard, and how many remain to set.
Parameters:
-
message
Stringthe message to display
Returns:
void
showModal
()
makes the overlay visible
Returns:
void