-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
59 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2017, University of Colorado Boulder | ||
|
||
/** | ||
* | ||
* @author Sam Reid (PhET Interactive Simulations) | ||
* @author Andrew Adare (PhET Interactive Simulations) | ||
*/ | ||
define( function( require ) { | ||
'use strict'; | ||
|
||
// modules | ||
var assertInstanceOf = require( 'ifphetio!PHET_IO/assertInstanceOf' ); | ||
var beersLawLab = require( 'BEERS_LAW_LAB/beersLawLab' ); | ||
var phetioInherit = require( 'ifphetio!PHET_IO/phetioInherit' ); | ||
var TNumber = require( 'ifphetio!PHET_IO/types/TNumber' ); | ||
var TObject = require( 'ifphetio!PHET_IO/types/TObject' ); | ||
var TVector2 = require( 'DOT/TVector2' ); | ||
|
||
/** | ||
* | ||
* @param instance | ||
* @param phetioID | ||
* @constructor | ||
*/ | ||
function TSoluteParticle( instance, phetioID ) { | ||
assert && assertInstanceOf( instance, phet.beersLawLab.PrecipitateParticle ); | ||
TObject.call( this, instance, phetioID ); | ||
} | ||
|
||
phetioInherit( TObject, 'TSoluteParticle', TSoluteParticle, {}, { | ||
|
||
fromStateObject: function( stateObject ) { | ||
return { | ||
location: TVector2.fromStateObject( stateObject.location ), | ||
orientation: TNumber.fromStateObject( stateObject.orientation ) | ||
}; | ||
}, | ||
|
||
toStateObject: function( value ) { | ||
return { | ||
location: TVector2.toStateObject( value.locationProperty.get() ), | ||
orientation: TNumber.toStateObject( value.orientation ) | ||
}; | ||
}, | ||
documentation: 'A particle that shows at the bottom of a saturated solution.' | ||
} ); | ||
|
||
beersLawLab.register( 'TSoluteParticle', TSoluteParticle ); | ||
|
||
return TSoluteParticle; | ||
} ); |