phetsims / neuron

"Neuron" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 3 forks source link

NeuronModel should inherit from RecordAndPlaybackModel, not ParticleCapture #54

Closed jbphet closed 9 years ago

jbphet commented 9 years ago

In the Java code, NeuronModel extended RecordAndPlaybackModel and implemented the IParticleCapture interface. In the ported JavaScript version, there is a ParticleCapture class that inherits from RecordAndPlaybackModel, and NeuronModel then inherits from ParticleCapture. While this works, it's a bit hard to figure out the workings of the JavaScript code when it's structured this way. NeuronModel should be made to inherit directly from RecordAndPlaybackModel, and it should just implement the needed interface.

If we choose to make the ported code more JavaScript-ish, we can pass the capture method to all of the membrane channels instead of the entire model, as is done now, and was done in Java as type IParticleCapture.

AshrafSharf commented 9 years ago

NeuronModel now directly inherits from RecordAndPlayBackModel.

jbphet commented 9 years ago

Changes look good, and it eliminates a nice chunk of unneeded code. Closing.