From 4da97de6edd9048fcac5974b735d66b90aef1bc4 Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Fri, 12 Jul 2024 16:07:18 -0600 Subject: [PATCH] remove TODO, https://github.com/phetsims/density-buoyancy-common/issues/256 Signed-off-by: Michael Kauzmann --- js/buoyancy/model/shapes/BuoyancyShapesModel.ts | 6 ++---- js/common/view/MaterialControlNode.ts | 6 ++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/buoyancy/model/shapes/BuoyancyShapesModel.ts b/js/buoyancy/model/shapes/BuoyancyShapesModel.ts index d64894db..96d3b28f 100644 --- a/js/buoyancy/model/shapes/BuoyancyShapesModel.ts +++ b/js/buoyancy/model/shapes/BuoyancyShapesModel.ts @@ -29,7 +29,6 @@ import Duck from './Duck.js'; import BuoyancyShapeModel from './BuoyancyShapeModel.js'; import ReferenceIO from '../../../../../tandem/js/types/ReferenceIO.js'; import IOType from '../../../../../tandem/js/types/IOType.js'; -import MaterialProperty from '../../../common/model/MaterialProperty.js'; export type BuoyancyShapesModelOptions = DensityBuoyancyModelOptions; @@ -41,7 +40,7 @@ export default class BuoyancyShapesModel extends DensityBuoyancyModel { public readonly shapeAModel: BuoyancyShapeModel; public readonly shapeBModel: BuoyancyShapeModel; - public readonly materialProperty: MaterialProperty; + public readonly materialProperty: Property; public constructor( options: BuoyancyShapesModelOptions ) { @@ -52,8 +51,7 @@ export default class BuoyancyShapesModel extends DensityBuoyancyModel { phetioFeatured: true } ); - // TODO: Not sure about this, https://github.com/phetsims/density-buoyancy-common/issues/256 - this.materialProperty = new MaterialProperty( Material.WOOD, { + this.materialProperty = new Property( Material.WOOD, { tandem: options.tandem.createTandem( 'materialProperty' ), phetioValueType: ReferenceIO( IOType.ObjectIO ) } ); diff --git a/js/common/view/MaterialControlNode.ts b/js/common/view/MaterialControlNode.ts index f9509876..34a1db10 100644 --- a/js/common/view/MaterialControlNode.ts +++ b/js/common/view/MaterialControlNode.ts @@ -45,7 +45,7 @@ export type MaterialControlNodeOptions = SelfMaterialControlNodeOptions & VBoxOp export default class MaterialControlNode extends VBox { - public constructor( materialProperty: MaterialProperty, + public constructor( materialProperty: Property, volumeProperty: Property, materials: Material[], listParent: Node, @@ -99,7 +99,9 @@ export default class MaterialControlNode extends VBox { // When switching to custom, set the custom density to the previous material's density (clamped just in case) if ( options.syncCustomMaterialDensity ) { - materialProperty.lazyLink( ( material, oldMaterial ) => { + assert && assert( materialProperty instanceof MaterialProperty ); // eslint-disable-line no-simple-type-checking-assertions + + materialProperty instanceof MaterialProperty && materialProperty.lazyLink( ( material, oldMaterial ) => { if ( material.custom ) { assert && assert( materialProperty.customMaterial === customMaterials[ 0 ], 'I would really rather know what customMaterial we are dealing with' );