Skip to content

Commit

Permalink
Use Property specific subclasses and specify values, see #191
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 28, 2018
1 parent d103662 commit 311c93d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion js/common/model/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ define( require => {
if ( this.waveSpatialType === WaveSpatialType.PLANE ) {

// @public {Property.<BarrierTypeEnum>} - type of the barrier in the lattice
this.barrierTypeProperty = new Property( BarrierTypeEnum.ONE_SLIT );
this.barrierTypeProperty = new Property( BarrierTypeEnum.ONE_SLIT, {
validValues: BarrierTypeEnum.VALUES
} );

// When the barrier moves, it creates a lot of artifacts, so clear the wave to the right of the barrier
// when it moves
Expand Down
8 changes: 5 additions & 3 deletions js/common/view/WaterEmitterNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ define( require => {
'use strict';

// modules
const BooleanProperty = require( 'AXON/BooleanProperty' );
const EmitterNode = require( 'WAVE_INTERFERENCE/common/view/EmitterNode' );
const FaucetNode = require( 'SCENERY_PHET/FaucetNode' );
const Property = require( 'AXON/Property' );
const NumberProperty = require( 'AXON/NumberProperty' );
const waveInterference = require( 'WAVE_INTERFERENCE/waveInterference' );
const WaveInterferenceUtils = require( 'WAVE_INTERFERENCE/common/WaveInterferenceUtils' );

Expand All @@ -37,11 +39,11 @@ define( require => {
1,

// Flow rate is managed by this simulation and not depicted by the FaucetNode
new Property( 0 ),
new NumberProperty( 0 ),

// Faucet is enabled but not interactive
new Property( true ), {
interactiveProperty: new Property( false ),
new BooleanProperty( true ), {
interactiveProperty: new BooleanProperty( false ),

// Adjusted based on the dimension of the faucet image to align with the horizontal water drop location.
// The vertical offset is adjusted with FAUCET_VERTICAL_OFFSET
Expand Down
5 changes: 3 additions & 2 deletions js/common/view/WaveInterferenceSceneIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ define( require => {

// modules
const BooleanProperty = require( 'AXON/BooleanProperty' );
const NumberProperty = require( 'AXON/NumberProperty' );
const FaucetNode = require( 'SCENERY_PHET/FaucetNode' );
const Image = require( 'SCENERY/nodes/Image' );
const LaserPointerNode = require( 'SCENERY_PHET/LaserPointerNode' );
Expand All @@ -22,8 +23,8 @@ define( require => {
constructor() {

// @public {FaucetNode} - Faucet icon, rasterized to clip out invisible parts (like the ShooterNode)
this.faucetIcon = new FaucetNode( 1, new Property( 0 ), new Property( true ), {
interactiveProperty: new Property( false )
this.faucetIcon = new FaucetNode( 1, new NumberProperty( 0 ), new BooleanProperty( true ), {
interactiveProperty: new BooleanProperty( false )
} ).rasterized();

// @public - Speaker icon
Expand Down
2 changes: 1 addition & 1 deletion js/waves/model/WavesScreenModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ define( require => {

// @public {Property.<Scene>} - selected scene
this.sceneProperty = new Property( this.waterScene, {
validValues: [ this.waterScene, this.soundScene, this.lightScene ]
validValues: this.scenes
} );

// @public {BooleanProperty} - whether the wave area should be displayed
Expand Down

0 comments on commit 311c93d

Please sign in to comment.