phetsims / mean-share-and-balance

"Mean: Share and Balance" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 1 forks source link

Move IOType implementation to core type #306

Closed marlitas closed 1 week ago

marlitas commented 2 weeks ago

From slack @pixelzoom said: " In general, put as much of the implementation as possible in the core type, and keep the IOType light." So setDataPoints and the like should call a method that is defined in the core type.

I also need to update the IOs to be private static readonly members of the core class type. This needs to be done in BalancePointModelIO, SharingModelIO, and LevelOutModelIO.

marlitas commented 1 week ago

Done above. Over to @jbphet for review.

jbphet commented 1 week ago

The general idea of moving the functionality from the IOType to the core type makes a lot of sense, and the code changes look reasonable to me.

@marlitas - Note that I changed the following constant...

public static readonly numberOfKicksRangeProperty = NUMBER_OF_KICKS_RANGE_PROPERTY;

...to...

public static readonly NUMBER_OF_KICKS_RANGE_PROPERTY= NUMBER_OF_KICKS_RANGE_PROPERTY;

...while reviewing this, since I think this is more in keeping with our coding conventions.

Other than that, all looks good. Closing.