Fluid is currently defined as:
// imports
var Property = require( "AXON/Property" );
/**
* @param {Color} color
* @constructor
*/
function Fluid( color ) {
this.color = new Property( color );
}
Fluid.prototype = {
reset: function() {
this.color.reset();
}
};
return Fluid;
If it were rewritten to use PropertySet, it would be defined as:
// imports
var PropertySet = require( "AXON/PropertySet" );
var inherit = require( 'PHET_CORE/inherit' );
/**
* @param {Color} color
* @constructor
*/
function Fluid( color ) {
PropertySet.call( this, {color: color} );
}
return inherit( PropertySet, Fluid );
The latter makes it possible to get/set the value directly, using
thisSolution.color = ConcentrationSolution.createColor( thisSolution.solvent, thisSolution.solute.get(), thisSolution.concentration.get() );
instead of
thisSolution.color.set( ConcentrationSolution.createColor( thisSolution.solvent, thisSolution.solute.get(), thisSolution.concentration.get() ) );
Property links would also need to be changed, if you convert to PropertySet. Not a big deal since there is just one property in this case, but just thought I would bring it up discussion because (a) it relates to uniformity between sims (b) if you add other properties to Fluid later, it will manage them well (automatically remember to reset them, etc) (c) the constructor is a bit shorter and (d) es5 get/set can be more convenient that Property.get() and Property.set()