phetsims / plinko-probability

"Plinko Probability" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
5 stars 7 forks source link

LabPlayPanel has redundant constructor args #112

Closed pixelzoom closed 6 years ago

pixelzoom commented 6 years ago

Constructor signature is:

function LabPlayPanel( model, ballModeProperty, isBallCapReachedProperty, options )

Call site is:

var playPanel = new LabPlayPanel( model, model.ballModeProperty, model.isBallCapReachedProperty, {...} )

So the ballModeProperty and isBallCapReachedProperty parameters are redundant. And they are in fact used inconsistently in LabPlayPanel's constructor, sometimes using model, sometimes using the redundant parameters. E.g.:

98  if ( model.isBallCapReachedProperty.get() ) {
141 isBallCapReachedProperty.lazyLink( function( isBallCapReached ) {

So I'm going to get rid of the redundant parameters.

pixelzoom commented 6 years ago

Similar problem with IntroPlayPanel.

pixelzoom commented 6 years ago

Addressed, closing.