diff --git a/js/common/model/CAVModel.ts b/js/common/model/CAVModel.ts index c7647fb6..5d82d781 100644 --- a/js/common/model/CAVModel.ts +++ b/js/common/model/CAVModel.ts @@ -53,7 +53,7 @@ export default class CAVModel implements TModel { public readonly isShowingMeanPredictionProperty: BooleanProperty; public readonly isShowingMedianPredictionProperty: BooleanProperty; - protected readonly maxNumberOfObjects = CAVConstants.NUMBER_OF_OBJECTS; + public readonly maxSoccerBalls = CAVConstants.NUMBER_OF_OBJECTS; public readonly physicalRange = new Range( 1, 15 ); public readonly medianValueProperty: Property; @@ -93,10 +93,10 @@ export default class CAVModel implements TModel { const updateDataMeasures = () => this.updateDataMeasures(); this.soccerBallCountProperty = new NumberProperty( 0, { - range: new Range( 0, this.maxNumberOfObjects ) + range: new Range( 0, this.maxSoccerBalls ) } ); - this.soccerBalls = _.range( 0, this.maxNumberOfObjects ).map( index => { + this.soccerBalls = _.range( 0, this.maxSoccerBalls ).map( index => { const position = new Vector2( 0, CAVObjectType.SOCCER_BALL.radius ); @@ -200,7 +200,7 @@ export default class CAVModel implements TModel { tandem: options.tandem.createTandem( 'timeWhenLastBallWasKickedProperty' ) } ); - this.soccerPlayers = _.range( 0, this.maxNumberOfObjects ).map( placeInLine => new SoccerPlayer( placeInLine ) ); + this.soccerPlayers = _.range( 0, this.maxSoccerBalls ).map( placeInLine => new SoccerPlayer( placeInLine ) ); // Create an initial ball to show on startup this.getNextBallFromPool(); @@ -215,7 +215,7 @@ export default class CAVModel implements TModel { soccerBall.animationModeProperty.value === AnimationMode.FLYING || soccerBall.animationModeProperty.value === AnimationMode.STACKING ); - const value = this.maxNumberOfObjects - kickedSoccerBalls.length - this.numberOfScheduledSoccerBallsToKickProperty.value; + const value = this.maxSoccerBalls - kickedSoccerBalls.length - this.numberOfScheduledSoccerBallsToKickProperty.value; return value; } ); @@ -430,7 +430,7 @@ export default class CAVModel implements TModel { soccerPlayer.poseProperty.value === Pose.KICKING ); if ( kickers.length > 0 ) { let nextIndex = this.activeKickerIndexProperty.value + 1; - if ( nextIndex > this.maxNumberOfObjects ) { + if ( nextIndex > this.maxSoccerBalls ) { nextIndex = 0; } this.activeKickerIndexProperty.value = nextIndex; diff --git a/js/common/view/CAVPlotNode.ts b/js/common/view/CAVPlotNode.ts index d3d604ef..bb7882e5 100644 --- a/js/common/view/CAVPlotNode.ts +++ b/js/common/view/CAVPlotNode.ts @@ -51,7 +51,7 @@ export default class CAVPlotNode extends Node { new Bounds2( model.physicalRange.min, 0, model.physicalRange.max, // TODO: Should this be maxDataPoints? - model.physicalRange.getLength() ), + model.maxSoccerBalls ), new Bounds2( 0, numberLinePositionY - CAVConstants.CHART_VIEW_WIDTH * yScale, 0 + CAVConstants.CHART_VIEW_WIDTH, numberLinePositionY ) ); this.modelViewTransform = modelViewTransform;