API Docs for:
Show:

discard.DiscardView Class

A view for discarding cards. Inherits from misc.BaseOverlay.

Constructor

discard.DiscardView

()

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 Boolean

    whether or not a player can discard yet

Returns:

void

setResourceAmount

(
  • resource
  • amount
)

Sets the amount displayed for a single resource.

Parameters:

  • resource String

    the resource to discard (see catan.definitions.ResourceTypes)

  • amount Int

    the current amount to display

Returns:

void

setResourceAmountChangeEnabled

(
  • resource
  • increase
  • decrease
)

Enables/disables increasing or decreasing for a single resource.

Parameters:

  • resource String

    the resource to discard (see catan.definitions.ResourceTypes)

  • increase Boolean

    whether you can increase the amount displayed

  • decrease Boolean

    whether 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 String

    the resource to discard (see catan.definitions.ResourceTypes)

  • amt Int

    the 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 String

    the message to display

Returns:

void

showModal

()

makes the overlay visible

Returns:

void