API Docs for:
Show:

maritime.MaritimeView Class

A view for setting up trades between the client player and the bank.

Constructor

maritime.MaritimeView

()

Methods

enableTradeButton

(
  • enable
)

Enables or disables the button

Parameters:

  • enable Boolean

    whether to enable the button or not

hideGetOptions

()

Disables all the resources that the player could receive

hideGiveOptions

()

Disables all the resources that the player could give

selectGetOption

(
  • resource
  • the
)

Hides all the resources except the one the player has selected.

Parameters:

  • resource String

    the resource the player has selected to receive (a resource: "wood","brick","sheep","wheat","ore")

  • the Int

    amount the player has to receive of the selected resource

selectGiveOption

(
  • resource
  • the
)

Hides all the resources except the one the player has selected.

Parameters:

  • resource String

    the resource the player has selected to give (a resource: "wood","brick","sheep","wheat","ore")

  • the Int

    amount the player has to give of the selected resource

setController

(
  • controller
)

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

Parameters:

  • controller maritime.Controller

Returns:

void

setMessage

(
  • message
)

Sets the message on the button

Parameters:

  • message String

    the message to display

showGetOptions

(
  • resources
)

Shows all the resources, enabling the ones the player can receive, and disabling the ones he can't.

Parameters:

  • resources Array

    the resources a player can receive

showGiveOptions

(
  • resources
)

Shows all the resources, enabling the ones the player can give, and disabling the ones he can't.

Parameters:

  • resources String

    the resources the player can give, based on current ports