Skip to content

Commit

Permalink
Rename maxSoccerBalls and use for the transform y dimension, see #45
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Apr 30, 2023
1 parent 1eaefad commit 1267c6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions js/common/model/CAVModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<number | null>;
Expand Down Expand Up @@ -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 );

Expand Down Expand Up @@ -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();
Expand All @@ -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;
} );
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/CAVPlotNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1267c6b

Please sign in to comment.