API Docs for:
Show:

resources.ResourceBarView Class

View to display client player's current resources: Resources (wood, sheep, ore, brick, wheat) and Buyable Options (houses, roads, cities). It also includes: Option to buy a Development card Option to play a Development card The number of armies the player has used It calls the following controller methods: "buildRoad", "buildSettlement", "buildCity", "buyCard", "playCard"

Constructor

resources.ResourceBarView

()

Methods

setActionEnabled

(
  • value
  • enabled
)

Enables or disables an element of the resource bar

Parameters:

  • value String

    the element to change ("wood","brick","sheep","wheat","ore","Roads","Settlements","Cities","BuyCard","DevCards","Soldiers"). These constants are defined in StudentDefinitions.js

  • enabled Boolean

    whether to enable the button

Returns:

void

setController

(
  • controller
)

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

Parameters:

  • controller ResourceController

    the controller

Returns:

void

updateAmount

(
  • value
  • amount
)

Updates the display for an element of the resource bar

Parameters:

  • value String

    the element to change ("wood","brick","sheep","wheat","ore","Roads","Settlements","Cities","BuyCard","DevCards","Soldiers"). These constants are defined in StudentDefinitions.js

  • amount Int

    the display amount (can be undefined)

Returns:

void