Skip to content

Commit

Permalink
JSDoc, see #409
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Mar 7, 2018
1 parent 6881ad9 commit f58213f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion js/energy-skate-park-basics/model/ControlPointIO.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@ define( function( require ) {
phetioInherit( ObjectIO, 'ControlPointIO', ControlPointIO, {}, {
documentation: 'A control point that can manipulate the track.',

/**
* Encodes a ControlPoint instance to a state.
* @param {ControlPoint} controlPoint
* @returns {Object}
*/
toStateObject: function( controlPoint ) {
assert && assertInstanceOf( controlPoint, phet.energySkateParkBasics.ControlPoint );
return controlPoint ? controlPoint.tandem.phetioID : 'null';
},

// Support null
/**
* Decodes a ControlPoint from a state object. Supports null.
*
* @param {Object} stateObject
* @return {ControlPoint}
*/
fromStateObject: function( stateObject ) {
if ( stateObject === 'null' ) {
return null;
Expand Down

0 comments on commit f58213f

Please sign in to comment.