ProducerChoice
ProducerChoice()
This function handles the entirety of the Producer Choice stage. Initializes player(producer), game, producer's warrants and different states that will rerender the page based on actions.
Kind: global function
- ProducerChoice()
- ~rounds ⇒
- ~addItem() ⇒
Array.<string>
- ~selectWarrant()
- ~handleSubmit() ⇒
ProducerChoice~rounds ⇒
This loop takes in the number of rounds from the treatment and verifies the round exists.
Kind: inner constant of ProducerChoice
Returns: N/A
ProducerChoice~addItem() ⇒ Array.<string>
This function adds in the current round's produced item's quality into an array of strings.
Kind: inner method of ProducerChoice
Returns: Array.<string>
- The list of producer's product qualities with the appended string.
Example
addItem("low") -> ["low"];
// Returns the list of the producer's product qualities with the appended product.
ProducerChoice~selectWarrant()
Author: Isa, Tiger.
set's the warrantStatus and clickCounter useState to conditonally render the warrant tag. clickCounter is used to not render a color before an option is picked by the producer.
Kind: inner method of ProducerChoice
ProducerChoice~handleSubmit() ⇒
This function is the handle submit that updates capital based on product quality and warrant status.
Kind: inner method of ProducerChoice
Returns: The user interface code after it updates fields (capital, currentQuality, Warrant Status)