Skip to content

Commit

Permalink
Address TODO, see phetsims/chipper#1360
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 5, 2023
1 parent ef46a07 commit 96ba827
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions js/view/CircuitElementToolFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import EnumerationProperty from '../../../axon/js/EnumerationProperty.js';
import optionize from '../../../phet-core/js/optionize.js';
import TReadOnlyProperty from '../../../axon/js/TReadOnlyProperty.js';
import PhetioGroup from '../../../tandem/js/PhetioGroup.js';
import PickRequired from '../../../phet-core/js/types/PickRequired.js';

const acSourceStringProperty = CircuitConstructionKitCommonStrings.acSourceStringProperty;
const capacitorStringProperty = CircuitConstructionKitCommonStrings.capacitorStringProperty;
Expand Down Expand Up @@ -128,12 +129,16 @@ export default class CircuitElementToolFactory {
* - in the center of the socket
* @param [providedOptions]
*/
public createCircuitElementToolNode( labelStringProperty: TReadOnlyProperty<string>, count: number, createIcon: ( t: Tandem, p: Property<CircuitElementViewType> ) => Node,
predicate: ( circuitElement: CircuitElement ) => boolean, createElement: ( v: Vector2 ) => CircuitElement, providedOptions?: CreateCircuitElementToolNodeProvidedOptions ): CircuitElementToolNode {
public createCircuitElementToolNode(
labelStringProperty: TReadOnlyProperty<string>,
count: number,
createIcon: ( t: Tandem, p: Property<CircuitElementViewType> ) => Node,
predicate: ( circuitElement: CircuitElement ) => boolean,
createElement: ( v: Vector2 ) => CircuitElement,
providedOptions?: CreateCircuitElementToolNodeProvidedOptions & PickRequired<Node, 'tandem'> ): CircuitElementToolNode {

assert && assert( Number.isInteger( count ), 'count should be an integer' );

// TODO SR: please make sure that we PickRequired<ParentOptions, 'tandem'> here if applicable
const options = optionize<CreateCircuitElementToolNodeProvidedOptions, CreateCircuitElementToolNodeSelfOptions, CircuitElementToolNodeOptions>()( {
additionalProperty: new BooleanProperty( true ),
lifelikeIconHeight: CCKCConstants.TOOLBOX_ICON_HEIGHT,
Expand Down

0 comments on commit 96ba827

Please sign in to comment.