Skip to content

Commit

Permalink
Create tandem in parent class, see: phetsims/mean-share-and-balance#253
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed May 29, 2024
1 parent 96b2d22 commit 6c19e30
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions js/view/SoccerScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ import GroupSortInteractionView from '../../../scenery-phet/js/accessibility/gro
import dragIndicatorHand_png from '../../../scenery-phet/images/dragIndicatorHand_png.js';
import Vector2 from '../../../dot/js/Vector2.js';
import { SoccerBallPhase } from '../model/SoccerBallPhase.js';
import Tandem from '../../../tandem/js/Tandem.js';
import WithRequired from '../../../phet-core/js/types/WithRequired.js';

type SelfOptions = {
physicalRange: Range;
chartViewWidth: number;
numberLineXMargin: number;
groundPositionY?: number;
numberLineNodeTandem?: Tandem | null;
};

export const DRAG_CUE_SCALE = 0.8;

export type SoccerScreenViewOptions = SelfOptions & ScreenViewOptions;
export type SoccerScreenViewOptions = SelfOptions & WithRequired<ScreenViewOptions, 'tandem'>;

export default class SoccerScreenView<T extends SoccerSceneModel, Q extends SoccerModel<T>> extends ScreenView {

Expand All @@ -55,8 +54,7 @@ export default class SoccerScreenView<T extends SoccerSceneModel, Q extends Socc

const options = optionize<SoccerScreenViewOptions, SelfOptions, ScreenViewOptions>()( {
isDisposable: false,
groundPositionY: SoccerCommonConstants.GROUND_POSITION_Y,
numberLineNodeTandem: null
groundPositionY: SoccerCommonConstants.GROUND_POSITION_Y
}, providedOptions );

super( options );
Expand All @@ -78,7 +76,7 @@ export default class SoccerScreenView<T extends SoccerSceneModel, Q extends Socc
includeXAxis: false,
x: options.numberLineXMargin,
y: groundPositionY,
tandem: options.numberLineNodeTandem ? options.numberLineNodeTandem : undefined
tandem: options.tandem?.createTandem( 'playAreaNumberLineNode' )
} );

/**
Expand Down

0 comments on commit 6c19e30

Please sign in to comment.