API Docs for:
Show:

resources.ResourceBarController Class

Controller class for the Resources View.

Constructor

resources.ResourceBarController

(
  • view
  • clientModel
  • actions
)

Parameters:

  • view resources.View

    The resource view

  • clientModel models.ClientModel

    The client model

  • actions Object

    The actions to take for each user input. The value of actions.elem_name is a function that is called when the specific element is selected (accessed by calling actions["elem_name"]). The valid element names are defined in StudentDefinitions.js

Methods

buildCity

()

The action to take on clicking the resource bar city button. Brings up the map overlay and allows you to place a city.

Returns:

void

buildRoad

()

The action to take on clicking the resource bar road button. Brings up the map overlay and allows you to place a road.

Returns:

void

buildSettlement

()

The action to take on clicking the resource bar settlement button. Brings up the map overlay and allows you to place a settlement.

Returns:

void

buyCard

()

The action to take on clicking the resource bar "buy a card" button. Should bring up the "buy a card" overlay.

Returns:

void

playCard

()

The action to take on clicking the resource bar "play a card" button. Should bring up the "play a card" overlay.

Returns:

void