Skip to content

Commit

Permalink
reflectsBorder => reflectingBorder for naming consistency, see #153
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Aug 26, 2020
1 parent 1dbe419 commit 68d7e22
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion js/common/model/CollisionEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class CollisionEngine {
detectBallToBorderCollisions( elapsedTime ) {
assert && assert( typeof elapsedTime === 'number' && elapsedTime >= 0, `invalid elapsedTime: ${elapsedTime}` );

this.playArea.reflectsBorder && this.ballSystem.balls.forEach( ball => {
this.playArea.reflectingBorder && this.ballSystem.balls.forEach( ball => {

// Only detect new ball-border collisions if it hasn't already been detected.
if ( !CollisionLabUtils.any( this.collisions, collision => collision.includesBodies( ball, this.playArea ) ) ) {
Expand Down
6 changes: 3 additions & 3 deletions js/common/model/PlayArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PlayArea {
isGridVisibleInitially: false,

// {boolean} - indicates if the PlayArea's borders reflect initially (and after resetting).
reflectsBorderInitially: true,
reflectingBorderInitially: true,

// {number} - the initial elasticity of the PlayArea (and after resetting), as a percentage.
initialElasticityPercent: ELASTICITY_PERCENT_RANGE.max
Expand All @@ -66,7 +66,7 @@ class PlayArea {

// @public {Property.<boolean>} - indicates if the Balls reflect at the Border of the PlayArea bounds. This Property
// is manipulated in the view.
this.reflectingBorderProperty = new BooleanProperty( options.reflectsBorderInitially );
this.reflectingBorderProperty = new BooleanProperty( options.reflectingBorderInitially );

// @public {Property.<boolean>} - indicates if the grid of the PlayArea is visible. This is placed inside of the model
// since the visibility of the grid affects the drag-snapping of Balls.
Expand Down Expand Up @@ -99,7 +99,7 @@ class PlayArea {
*
* @returns {boolean}
*/
get reflectsBorder() {
get reflectingBorder() {
return this.reflectingBorderProperty.value;
}

Expand Down
4 changes: 2 additions & 2 deletions js/inelastic/model/InelasticCollisionEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class InelasticCollisionEngine extends CollisionEngine {
assert && assert( this.rotatingBallCluster, 'cannot call detectBallClusterToBorderCollision' );

// No-op if the PlayArea's border doesn't reflect or the cluster-to-border collision has already been detected.
if ( !this.playArea.reflectsBorder ||
if ( !this.playArea.reflectingBorder ||
CollisionLabUtils.any( this.collisions, collision => collision.includes( this.rotatingBallCluster ) ) ) {
return; /** do nothing **/
}
Expand Down Expand Up @@ -282,7 +282,7 @@ class InelasticCollisionEngine extends CollisionEngine {
willBallClusterCollideWithBorderIn( dt ) {
assert && assert( typeof dt === 'number', `invalid dt: ${dt}` );
assert && assert( this.rotatingBallCluster, 'cannot call willBallClusterCollideWithBorderIn' );
assert && assert( this.playArea.reflectsBorder, 'cannot call willBallClusterCollideWithBorderIn' );
assert && assert( this.playArea.reflectingBorder, 'cannot call willBallClusterCollideWithBorderIn' );

// Get the states of the Balls after the time-delta.
const rotationStates = this.rotatingBallCluster.getSteppedRotationStates( dt );
Expand Down
6 changes: 3 additions & 3 deletions js/intro/model/IntroPlayArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class IntroPlayArea extends PlayArea {
options = merge( {

isGridVisibleInitially: true,
reflectsBorderInitially: false,
reflectingBorderInitially: false,
bounds: new Bounds2(
PlayArea.DEFAULT_BOUNDS.left,
-CollisionLabConstants.PLAY_AREA_1D_HEIGHT / 2,
Expand All @@ -46,8 +46,8 @@ class IntroPlayArea extends PlayArea {
} );

// Verify that the border never reflects for the 'Intro' screen.
assert && this.reflectingBorderProperty.link( reflectsBorder => {
assert( reflectsBorder === false, 'No reflecting borders for the Intro screen.' );
assert && this.reflectingBorderProperty.link( reflectingBorder => {
assert( reflectingBorder === false, 'No reflecting borders for the Intro screen.' );
} );
}
}
Expand Down

0 comments on commit 68d7e22

Please sign in to comment.