Skip to content

Commit

Permalink
Add TODOs to generalize dragEndedListener. See #61.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisav1 committed Oct 31, 2022
1 parent 196e4f4 commit 52eb818
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/decay/view/DecayScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,12 @@ class DecayScreenView extends BANScreenView<DecayModel> {
/**
* Define a function that will decide where to put nucleons.
*/
// TODO: generalize this into BANScreenView
protected override dragEndedListener( nucleon: Particle, atom: ParticleAtom ): void {
const particleCreatorNodeCenter = nucleon.type === ParticleType.PROTON.name.toLowerCase() ?
this.protonsCreatorNode.center : this.neutronsCreatorNode.center;

// TODO: pass in boolean here from subclass function
if ( nucleon.positionProperty.value.distance( atom.positionProperty.value ) < NUCLEON_CAPTURE_RADIUS ||

// if removing the nucleon will create a nuclide that does not exist, re-add the nucleon to the atom
Expand Down

1 comment on commit 52eb818

@Luisav1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #46.

Please sign in to comment.