phetsims / color-vision

"Color Vision" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/color-vision
GNU General Public License v3.0
1 stars 7 forks source link

RGBModel reset can be simplified #11

Closed samreid closed 10 years ago

samreid commented 10 years ago

RGBModel implements reset like so:

      reset: function() {
        this.redIntensityProperty.value = 0;
        this.greenIntensityProperty.value = 0;
        this.blueIntensityProperty.value = 0;
        this.perceivedRedIntensityProperty.value = 0;
        this.perceivedGreenIntensityProperty.value = 0;
        this.perceivedBlueIntensityProperty.value = 0;

        this.redBeam.reset();
        this.greenBeam.reset();
        this.blueBeam.reset();
      }

But since the RGBModel inherits from PropertySet, I think the first 6 lines of that body can be replaced with:

PropertySet.prototype.reset.call( this );
aaronsamuel137 commented 10 years ago

Assigning to @samreid for review

samreid commented 10 years ago

Looks good, thanks! Closing.