maritime.MaritimeView Class
A view for setting up trades between the client player and the bank.
Constructor
maritime.MaritimeView
()
Item Index
Methods
enableTradeButton
-
enable
Enables or disables the button
Parameters:
-
enable
Booleanwhether 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
Stringthe resource the player has selected to receive (a resource: "wood","brick","sheep","wheat","ore")
-
the
Intamount 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
Stringthe resource the player has selected to give (a resource: "wood","brick","sheep","wheat","ore")
-
the
Intamount 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
Stringthe 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
Arraythe 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
Stringthe resources the player can give, based on current ports