Skip to content

Commit

Permalink
Add REVIEW comments, see #123
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed May 29, 2024
1 parent af0d63d commit bbb9f60
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/buoyancy/model/BuoyancyApplicationsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,16 @@ export default class BuoyancyApplicationsModel extends DensityBuoyancyModel {
} );

// Adjust pool volume so that it's at the desired value WITH the pool scales inside.
// REVIEW: How does this relate to https://github.com/phetsims/density-buoyancy-common/blob/4038cb05c2b5c2b8b1f600bfbcf0a7eaac4617a2/js/common/model/DensityBuoyancyModel.ts#L435-L437
this.pool.liquidVolumeProperty.setInitialValue( this.pool.liquidVolumeProperty.value );

// This instance lives for the lifetime of the simulation, so we don't need to remove this listener
this.sceneProperty.link( ( scene, previousScene ) => {
this.bottle.internalVisibleProperty.value = scene === 'bottle';
this.boat.internalVisibleProperty.value = scene === 'boat';
this.block.internalVisibleProperty.value = scene === 'boat';

// As described in https://github.com/phetsims/buoyancy/issues/118#issue-2192969056, the underwater scale only shows for the bottle scene, not for the boat
this.scale2!.internalVisibleProperty.value = scene === 'bottle';

// When switching from boat to bottle scene, subtract the scale volume from the pool and vice versa (-1 and 1)
Expand Down Expand Up @@ -143,6 +146,8 @@ export default class BuoyancyApplicationsModel extends DensityBuoyancyModel {
*/
public override reset(): void {

// REVIEW: Can we call resetBoatScene from reset?

this.bottle.reset();
this.block.reset();
this.boat.reset();
Expand Down

0 comments on commit bbb9f60

Please sign in to comment.