Skip to content

Commit

Permalink
Remove unused parameters, see #31
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 26, 2024
1 parent c10f4f0 commit 01ecb41
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 31 deletions.
4 changes: 2 additions & 2 deletions js/common-vsm/view/ProjectileSelectorNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export default class ProjectileSelectorNode extends SelectorNode {
visibleProperty: new DerivedProperty( [ selectedProjectileProperty ], projectile => projectile !== null )
} );

Multilink.multilink( [ selectedProjectileNumberProperty, numberOfLandedProjectilesProperty, selectedProjectileProperty ],
( selectedProjectileNumber, numberOfLandedProjectiles, selectedProjectile ) => {
Multilink.multilink( [ selectedProjectileProperty, selectedProjectileNumberProperty, numberOfLandedProjectilesProperty ],
selectedProjectile => {

if ( selectedProjectile ) {

Expand Down
5 changes: 1 addition & 4 deletions js/common-vsm/view/VSMFieldSignNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { Text, VBox } from '../../../../scenery/js/imports.js';
import PDLConstants from '../../common/PDLConstants.js';
import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js';
import Field from '../../common/model/Field.js';
import ModelViewTransform2 from '../../../../phetcommon/js/view/ModelViewTransform2.js';
import { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
import PDLColors from '../../common/PDLColors.js';
import ProjectileSelectorNode from './ProjectileSelectorNode.js';
Expand All @@ -27,8 +26,6 @@ type VSMFieldSignNodeOptions = SelfOptions & FieldSignNodeOptions;
export default class VSMFieldSignNode extends FieldSignNode {
public constructor( fields: Field[],
fieldProperty: TReadOnlyProperty<Field>,
numberOfLandedProjectilesProperty: TReadOnlyProperty<number>,
modelViewTransform: ModelViewTransform2,
projectileSelectorNode: ProjectileSelectorNode,
providedOptions?: VSMFieldSignNodeOptions ) {

Expand All @@ -51,7 +48,7 @@ export default class VSMFieldSignNode extends FieldSignNode {
maxWidth: 100
} );

super( fields, fieldProperty, fieldSignHeadingContainer, projectileSelectorNode, 34, options );
super( fieldProperty, fieldSignHeadingContainer, projectileSelectorNode, 34, options );
}
}

Expand Down
2 changes: 0 additions & 2 deletions js/common-vsm/view/VSMScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ export default abstract class VSMScreenView<T extends VSMField> extends PDLScree
this.fieldSignNode = new VSMFieldSignNode(
model.fields,
model.fieldProperty,
model.numberOfLandedProjectilesProperty,
this.modelViewTransform,
this.projectileSelectorNode
);

Expand Down
2 changes: 1 addition & 1 deletion js/common/view/FieldNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class FieldNode extends Node {
// The field
private readonly fieldBorder: Node;

public constructor( fields: Field[], fieldProperty: TReadOnlyProperty<Field>, binWidthProperty: TReadOnlyProperty<number>, providedOptions: FieldNodeOptions ) {
public constructor( fieldProperty: TReadOnlyProperty<Field>, binWidthProperty: TReadOnlyProperty<number>, providedOptions: FieldNodeOptions ) {

const fieldBounds = new Bounds2(
-0.5 * PDLConstants.FIELD_WIDTH,
Expand Down
12 changes: 6 additions & 6 deletions js/common/view/FieldSignNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ type SelfOptions = EmptySelfOptions;
export type FieldSignNodeOptions = SelfOptions & VBoxOptions;

export default class FieldSignNode extends VBox {
public constructor( fields: Field[],
fieldProperty: TReadOnlyProperty<Field>,
private readonly headingText: Node,
selectorNode: SelectorNode,
signPostHeight: number,
providedOptions: FieldSignNodeOptions ) {
public constructor(
fieldProperty: TReadOnlyProperty<Field>,
private readonly headingText: Node,
selectorNode: SelectorNode,
signPostHeight: number,
providedOptions: FieldSignNodeOptions ) {

const options = optionize<FieldSignNodeOptions, SelfOptions, VBoxOptions>()( {
stretch: true
Expand Down
4 changes: 2 additions & 2 deletions js/common/view/PDLScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ export default abstract class PDLScreenView<T extends Field> extends ScreenView
eraseResetContainerProxy.bottom = this.layoutBounds.maxY - PDLConstants.SCREEN_VIEW_Y_MARGIN;
} );

const fieldBack = new FieldNode( model.fields, model.fieldProperty, model.histogram.binWidthProperty, {
const fieldBack = new FieldNode( model.fieldProperty, model.histogram.binWidthProperty, {
x: fieldX,
y: fieldY
} );
const fieldFront = new FieldNode( model.fields, model.fieldProperty, model.histogram.binWidthProperty, {
const fieldFront = new FieldNode( model.fieldProperty, model.histogram.binWidthProperty, {
isBottomHalf: true,
x: fieldX,
y: fieldY
Expand Down
4 changes: 2 additions & 2 deletions js/common/view/SimulationPreferencesContentNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Sam Reid (PhET Interactive Simulations)
*/

import { Node, Rectangle, RichText } from '../../../../scenery/js/imports.js';
import { Rectangle, RichText } from '../../../../scenery/js/imports.js';
import PreferencesControl from '../../../../joist/js/preferences/PreferencesControl.js';
import PreferencesDialogConstants from '../../../../joist/js/preferences/PreferencesDialogConstants.js';
import Tandem from '../../../../tandem/js/Tandem.js';
Expand All @@ -22,7 +22,7 @@ import { Checkbox } from '../../../../sun/js/imports.js';

export default class SimulationPreferencesContentNode extends PreferencesPanelContentNode {

public constructor( parentNode: Node, tandem: Tandem ) {
public constructor( tandem: Tandem ) {

const autoGenerateDataControlTandem = tandem.createTandem( 'autoGenerateDataControl' );
const projectileTypeAffectsSpeedControlTandem = tandem.createTandem( 'projectileTypeAffectsSpeedControl' );
Expand Down
2 changes: 1 addition & 1 deletion js/projectile-data-lab-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ simLauncher.launch( () => {
const preferencesModel = new PreferencesModel( {
simulationOptions: {
customPreferences: [ {
createContent: tandem => new SimulationPreferencesContentNode( phet.joist.sim.topLayer, tandem.createTandem( 'simPreferences' ) )
createContent: tandem => new SimulationPreferencesContentNode( tandem.createTandem( 'simPreferences' ) )
} ]
}
} );
Expand Down
2 changes: 1 addition & 1 deletion js/sampling/model/SamplingField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default class SamplingField extends Field {
phetioDocumentation: 'Mark the time when a phase began, so we can track how long we have been in the phase. For PhET-iO internal use only for managing state save and load.'
} );

const phaseChanged = ( phase: SamplingPhase ) => {
const phaseChanged = () => {
this.phaseStartTimeProperty.value = this.timeProperty.value;
this.updateComputedProperties();
};
Expand Down
2 changes: 1 addition & 1 deletion js/sampling/model/SamplingModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default class SamplingModel extends PDLModel<SamplingField> {

// When the field is changed, if the phase is showingAirborneProjectiles or showingCompleteSampleWithoutMean, change the mode from
// continuous to single
this.fieldProperty.lazyLink( field => {
this.fieldProperty.lazyLink( () => {

// redo all fields with the same mystery launcher, unless they already have data.
this.fields.forEach( field => {
Expand Down
3 changes: 1 addition & 2 deletions js/sampling/view/SamplingAccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ export default class SamplingAccordionBox extends HistogramAccordionBox {
histogram,
histogramSoundEnabledProperty,
ProjectileDataLabStrings.meanDistanceStringProperty,
comboBoxParent,
clearCurrentField, {
comboBoxParent, {
tandem: providedOptions.tandem.createTandem( 'histogramNode' )
} );

Expand Down
4 changes: 1 addition & 3 deletions js/sampling/view/SamplingFieldSignNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ProjectileDataLabStrings from '../../ProjectileDataLabStrings.js';
import { Text, VBox } from '../../../../scenery/js/imports.js';
import PDLConstants from '../../common/PDLConstants.js';
import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js';
import ModelViewTransform2 from '../../../../phetcommon/js/view/ModelViewTransform2.js';
import { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
import PDLColors from '../../common/PDLColors.js';
import Launcher from '../../common/model/Launcher.js';
Expand All @@ -29,7 +28,6 @@ export default class SamplingFieldSignNode extends FieldSignNode {
fieldProperty: TReadOnlyProperty<Field>,
launcherProperty: TReadOnlyProperty<Launcher>,
sampleSizeProperty: TReadOnlyProperty<number>,
modelViewTransform: ModelViewTransform2,
sampleSelectorNode: SampleSelectorNode,
providedOptions?: SamplingFieldSignNodeOptions ) {

Expand Down Expand Up @@ -61,7 +59,7 @@ export default class SamplingFieldSignNode extends FieldSignNode {
maxWidth: 120
} );

super( fields, fieldProperty, fieldSignHeadingContainer, sampleSelectorNode, 25, options );
super( fieldProperty, fieldSignHeadingContainer, sampleSelectorNode, 25, options );
}
}

Expand Down
1 change: 0 additions & 1 deletion js/sampling/view/SamplingHistogramNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default class SamplingHistogramNode extends HistogramNode {
histogramSoundEnabledProperty: TReadOnlyProperty<boolean>,
horizontalAxisLabelText: TReadOnlyProperty<string>,
comboBoxParent: Node,
clearCurrentField: () => void,
options: HistogramNodeOptions ) {

super(
Expand Down
5 changes: 2 additions & 3 deletions js/sampling/view/SamplingScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export default class SamplingScreenView extends PDLScreenView<SamplingField> {
model.fieldProperty,
model.launcherProperty,
model.sampleSizeProperty,
this.modelViewTransform,
sampleSelectorNode
);

Expand Down Expand Up @@ -206,8 +205,8 @@ export default class SamplingScreenView extends PDLScreenView<SamplingField> {
} );

// Position the time control node so that it is right-aligned underneath the accordion box
ManualConstraint.create( this, [ this.timeControlNode, this.accordionBox.bottomThumbnailNode, this.accordionBox ],
( timeControlNodeProxy, bottomThumbnailNodeProxy, accordionBoxProxy ) => {
ManualConstraint.create( this, [ this.timeControlNode, this.accordionBox, this.accordionBox.bottomThumbnailNode ],
( timeControlNodeProxy, accordionBoxProxy ) => {
timeControlNodeProxy.right = accordionBoxProxy.right - 3;
timeControlNodeProxy.top = accordionBoxProxy.bottom + PDLConstants.INTER_PANEL_SPACING + PDLConstants.TIME_CONTROL_MARGIN_TOP;
} );
Expand Down

0 comments on commit 01ecb41

Please sign in to comment.