Skip to content

Commit

Permalink
Factor out group select logic from GroupSortInteractionView, see: phe…
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed Nov 14, 2024
1 parent 02ba82a commit ff5c67f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions js/model/SoccerCommonGroupSortInteractionModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

import soccerCommon from '../soccerCommon.js';
import SoccerBall from './SoccerBall.js';
import GroupSortInteractionModel, { GroupSortInteractionModelOptions } from '../../../scenery-phet/js/accessibility/group-sort/model/GroupSortInteractionModel.js';
import GroupSelectModel, { GroupSelectModelOptions } from '../../../scenery-phet/js/accessibility/group-sort/model/GroupSelectModel.js';
import Multilink from '../../../axon/js/Multilink.js';
import SoccerSceneModel from './SoccerSceneModel.js';
import TReadOnlyProperty from '../../../axon/js/TReadOnlyProperty.js';

export default class SoccerCommonGroupSortInteractionModel<SceneModel extends SoccerSceneModel = SoccerSceneModel>
extends GroupSortInteractionModel<SoccerBall> {
extends GroupSelectModel<SoccerBall> {

public constructor( protected readonly selectedSceneModelProperty: TReadOnlyProperty<SceneModel>,
private readonly selectedSceneStackedSoccerBallCountProperty: TReadOnlyProperty<number>,
private readonly selectedSceneMaxKicksProperty: TReadOnlyProperty<number>,
sceneModels: SceneModel[], providedOptions?: GroupSortInteractionModelOptions<SoccerBall> ) {
sceneModels: SceneModel[], providedOptions?: GroupSelectModelOptions<SoccerBall> ) {
super( providedOptions );

const allValueProperties = sceneModels.flatMap( sceneModel => sceneModel.soccerBalls.map( soccerBall => soccerBall.valueProperty ) );
Expand Down
4 changes: 2 additions & 2 deletions js/view/SoccerCommonGroupSortInteractionView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import PickOptional from '../../../phet-core/js/types/PickOptional.js';
import StrictOmit from '../../../phet-core/js/types/StrictOmit.js';
import { SoccerBallPhase } from '../model/SoccerBallPhase.js';
import GroupSortInteractionView, { GroupSortInteractionViewOptions } from '../../../scenery-phet/js/accessibility/group-sort/view/GroupSortInteractionView.js';
import GroupSortInteractionModel from '../../../scenery-phet/js/accessibility/group-sort/model/GroupSortInteractionModel.js';
import GroupSelectModel from '../../../scenery-phet/js/accessibility/group-sort/model/GroupSelectModel.js';
import Range from '../../../dot/js/Range.js';

// A list of options that are required by the supertype, but optional here because
Expand All @@ -37,7 +37,7 @@ type SoccerCommonGroupSortInteractionViewOptions = SelfOptions & ParentOptions;
export default class SoccerCommonGroupSortInteractionView<SceneModel extends SoccerSceneModel> extends GroupSortInteractionView<SoccerBall, SoccerBallNode> {

public constructor(
groupSortInteractionModel: GroupSortInteractionModel<SoccerBall>,
groupSortInteractionModel: GroupSelectModel<SoccerBall>,
primaryFocusedNode: Node,
sceneModel: SceneModel,
selectedSceneModelProperty: TReadOnlyProperty<SceneModel>,
Expand Down

0 comments on commit ff5c67f

Please sign in to comment.