Skip to content

Commit

Permalink
use DerivedStringProperty where appropriate, #155
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Aug 1, 2024
1 parent 3519433 commit aa22dce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js/game/view/GameFeedbackPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/

import Property from '../../../../axon/js/Property.js';
import DerivedProperty from '../../../../axon/js/DerivedProperty.js';
import StringUtils from '../../../../phetcommon/js/util/StringUtils.js';
import FaceNode from '../../../../scenery-phet/js/FaceNode.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
Expand All @@ -32,6 +31,7 @@ import optionize from '../../../../phet-core/js/optionize.js';
import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js';
import Equation from '../../common/model/Equation.js';
import Disposable from '../../../../axon/js/Disposable.js';
import DerivedStringProperty from '../../../../axon/js/DerivedStringProperty.js';

// constants
const TEXT_FONT = new PhetFont( 18 );
Expand Down Expand Up @@ -86,7 +86,7 @@ export default class GameFeedbackPanel extends Node {
const faceNode = new FaceNode( 75 );
if ( !equation.balancedProperty.value ) { faceNode.frown(); }

const pointsAwardedStringProperty = new DerivedProperty(
const pointsAwardedStringProperty = new DerivedStringProperty(
[ BalancingChemicalEquationsStrings.pattern_0pointsStringProperty ],
pattern => StringUtils.format( pattern, points )
);
Expand Down
4 changes: 2 additions & 2 deletions js/game/view/LevelSelectionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @author Vasily Shakhov (mlearner.com)
*/

import DerivedProperty from '../../../../axon/js/DerivedProperty.js';
import Bounds2 from '../../../../dot/js/Bounds2.js';
import { AtomNodeOptions } from '../../../../nitroglycerin/js/nodes/AtomNode.js';
import { combineOptions } from '../../../../phet-core/js/optionize.js';
Expand All @@ -25,6 +24,7 @@ import Molecule from '../../common/model/Molecule.js';
import GameModel from '../model/GameModel.js';
import GameViewProperties from './GameViewProperties.js';
import BCEQueryParameters from '../../common/BCEQueryParameters.js';
import DerivedStringProperty from '../../../../axon/js/DerivedStringProperty.js';

// Molecules that appear on level-selection buttons, ordered by level number
const levelMolecules = [ Molecule.HCl, Molecule.H2O, Molecule.NH3 ];
Expand Down Expand Up @@ -116,7 +116,7 @@ export default class LevelSelectionNode extends Node {
*/
function createLevelSelectionButtonIcon( level: number, moleculeAlignGroup: AlignGroup ): Node {

const labelStringProperty = new DerivedProperty(
const labelStringProperty = new DerivedStringProperty(
[ BalancingChemicalEquationsStrings.pattern_0levelStringProperty ],
pattern => StringUtils.format( pattern, level + 1 )
);
Expand Down

0 comments on commit aa22dce

Please sign in to comment.