Skip to content

Commit

Permalink
Move EnergyLevelModel to ChartIntroModel.ts. See #46.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisav1 committed Dec 6, 2022
1 parent 488f421 commit 2bf0496
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions js/chart-intro/model/ChartIntroModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ import Tandem from '../../../../tandem/js/Tandem.js';
import buildANucleus from '../../buildANucleus.js';
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
import BANModel, { BANModelOptions } from '../../common/model/BANModel.js';
import EnergyLevelModel from './EnergyLevelModel.js';

// types
export type NuclideChartIntroModelOptions = BANModelOptions;

class ChartIntroModel extends BANModel {

public protonEnergyLevelModel: EnergyLevelModel;

public constructor( providedOptions?: NuclideChartIntroModelOptions ) {

const options = optionize<NuclideChartIntroModelOptions, EmptySelfOptions, BANModelOptions>()( {
Expand All @@ -27,6 +30,9 @@ class ChartIntroModel extends BANModel {
// empirically determined, the last nuclide the NuclideChartIntro screen goes up to is Neon-22 (10 protons and 12 neutrons)
super( 10, 12, options );

// TODO: pass in what particle it's tracking (ex. protonCountProperty)
this.protonEnergyLevelModel = new EnergyLevelModel();

}

public override reset(): void {
Expand Down
5 changes: 1 addition & 4 deletions js/chart-intro/view/ChartIntroScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import BANConstants from '../../common/BANConstants.js';
import ArrowNode from '../../../../scenery-phet/js/ArrowNode.js';
import BANColors from '../../common/BANColors.js';
import EnergyLevelNode from './EnergyLevelNode.js';
import EnergyLevelModel from '../model/EnergyLevelModel.js';
import ModelViewTransform2 from '../../../../phetcommon/js/view/ModelViewTransform2.js';
import Vector2 from '../../../../dot/js/Vector2.js';

Expand Down Expand Up @@ -112,9 +111,7 @@ class ChartIntroScreenView extends BANScreenView<ChartIntroModel> {
this.addChild( rightDashedLine );

// add energy level node
// TODO: pass in what particle it's tracking (ex. protonCountProperty)
const protonEnergyLevelModel = new EnergyLevelModel();
const protonEnergyLevelNode = new EnergyLevelNode( protonEnergyLevelModel, { x: this.protonArrowButtons.left, y: arrow.top + 20 } );
const protonEnergyLevelNode = new EnergyLevelNode( model.protonEnergyLevelModel, { x: this.protonArrowButtons.left, y: arrow.top + 20 } );
this.addChild( protonEnergyLevelNode );


Expand Down

0 comments on commit 2bf0496

Please sign in to comment.