Skip to content

Commit

Permalink
Migrate from ObservableArray => createObservableArray (Proxy), see ph…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Oct 2, 2020
1 parent 627c0e7 commit ff7564f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions js/common/model/BalanceModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js';
import ObservableArray from '../../../../axon/js/ObservableArray.js';
import createObservableArray from '../../../../axon/js/createObservableArray.js';
import Dimension2 from '../../../../dot/js/Dimension2.js';
import Vector2 from '../../../../dot/js/Vector2.js';
import inherit from '../../../../phet-core/js/inherit.js';
Expand All @@ -32,7 +32,7 @@ function BalanceModel( tandem ) {

// Model elements
self.fulcrum = new Fulcrum( new Dimension2( 1, FULCRUM_HEIGHT ) );
self.massList = new ObservableArray();
self.massList = createObservableArray();
self.userControlledMasses = []; // Masses being controlled by user(s), potentially more than one in touch environment.

self.columnStateProperty = new EnumerationProperty( ColumnState, ColumnState.DOUBLE_COLUMNS, {
Expand Down
8 changes: 4 additions & 4 deletions js/common/model/Plank.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Emitter from '../../../../axon/js/Emitter.js';
import NumberProperty from '../../../../axon/js/NumberProperty.js';
import ObservableArray from '../../../../axon/js/ObservableArray.js';
import createObservableArray from '../../../../axon/js/createObservableArray.js';
import Property from '../../../../axon/js/Property.js';
import Matrix3 from '../../../../dot/js/Matrix3.js';
import Vector2 from '../../../../dot/js/Vector2.js';
Expand Down Expand Up @@ -57,9 +57,9 @@ function Plank( position, pivotPoint, columnState, userControlledMasses, tandem
this.bottomCenterPositionProperty = new Property( position );

// Externally visible observable lists.
self.massesOnSurface = new ObservableArray();
self.forceVectors = new ObservableArray();
self.activeDropPositions = new ObservableArray(); // Positions where user-controlled masses would land if dropped, in meters from center.
self.massesOnSurface = createObservableArray();
self.forceVectors = createObservableArray();
self.activeDropPositions = createObservableArray(); // Positions where user-controlled masses would land if dropped, in meters from center.

// Other external visible attributes.
self.pivotPoint = pivotPoint;
Expand Down
6 changes: 3 additions & 3 deletions js/game/model/BalanceGameModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

import EnumerationProperty from '../../../../axon/js/EnumerationProperty.js';
import ObservableArray from '../../../../axon/js/ObservableArray.js';
import createObservableArray from '../../../../axon/js/createObservableArray.js';
import Property from '../../../../axon/js/Property.js';
import stepTimer from '../../../../axon/js/stepTimer.js';
import Dimension2 from '../../../../dot/js/Dimension2.js';
Expand Down Expand Up @@ -70,10 +70,10 @@ function BalanceGameModel( tandem ) {
self.challengeList = null;

// Fixed masses that sit on the plank and that the user must attempt to balance.
self.fixedMasses = new ObservableArray();
self.fixedMasses = createObservableArray();

// Masses that the user moves on to the plank to counterbalance the fixed masses.
self.movableMasses = new ObservableArray();
self.movableMasses = createObservableArray();

// Masses that the user is (or users are) moving.
self.userControlledMasses = [];
Expand Down

0 comments on commit ff7564f

Please sign in to comment.