API Docs for:
Show:

domestic.DomesticView Class

A view for setting up trades between players.

Constructor

domestic.DomesticView

()

Methods

clearTradeView

()

Resets the view

Returns:

void

setController

(
  • controller
)

Attaches the controller to the view and builds the view on the page.

Parameters:

  • controller domestic.Controller

Returns:

void

setPlayers

(
  • players
)

Sets the opponents to trade with for the player in the view. This should be called on initializing the controller, and only called once.

Parameters:

  • players Array

    The player's three opponents. Each must be of the form { name: the name of the player, color: the player's game color, index: the gameplay index of the player }

Returns:

void

setPlayerSelectionEnabled

(
  • shouldEnable
)

Turns on or off the ability to select a player to trade with

Parameters:

  • shouldEnable Boolean

    whether the player can trade or not

Returns:

void

setResourceAmount

(
  • resource
  • amount
)

Displays the amount for a resource

Parameters:

  • resource String

    the element to change (a resource: "wood","brick","sheep","wheat","ore")

  • amount Int

    the current amount the player wants to trade

Returns:

void

setResourceAmountChangeEnabled

(
  • resource
  • shouldIncrease
  • shouldDecrease
)

Turns on or off the ability to set amounts to trade for a reosurce

Parameters:

  • resource String

    the element to change (a resource: "wood","brick","sheep","wheat","ore")

  • shouldIncrease Boolean

    whether the player can set more of the resource

  • shouldDecrease Boolean

    whether the player can set less of the resource

Returns:

void

setResourceSelectionEnabled

(
  • shouldEnable
)

Turns on or off the ability to trade resources

Parameters:

  • shouldEnable Boolean

    whether the player can trade resources or not

Returns:

void

setStateMessage

(
  • message
)

Displays the message indicating the state of the trade

Parameters:

  • message String

    the message to display

Returns:

void

setTradeButtonEnabled

(
  • shouldEnable
)

Turns on or off the ability to trade

Parameters:

  • shouldEnable Boolean

    whether the player can trade or not

Returns:

void