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

Replace string literals with enumerations #146

Open pixelzoom opened 10 months ago

pixelzoom commented 10 months ago

Use StringEnumerationProperty or EnumerationProperty for the Properties shown below. This should be done before publishing a PhET-iO version.

// ColorVisionModel

    this.headModeProperty = new StringProperty( 'no-brain', {
      validValues: [ 'brain', 'no-brain' ],
      tandem: tandem.createTandem( 'headModeProperty' )
    } );

// SingleBulbModel

    this.lightTypeProperty = new StringProperty( 'colored', {
      validValues: [ 'white', 'colored' ],
      tandem: tandem.createTandem( 'lightTypeProperty' )
    } );

    // @public {Property.<string>} indicates solid beam vs individual photons
    this.beamTypeProperty = new StringProperty( 'beam', {
      validValues: [ 'beam', 'photon' ],
      tandem: tandem.createTandem( 'beamTypeProperty' )
    } );
Luisav1 commented 2 months ago

Deferring this issue since we're not going to republish with PhET-iO for the upcoming publication.