Skip to content

Commit

Permalink
Made a convenient getter in PointController
Browse files Browse the repository at this point in the history
  • Loading branch information
SaurabhTotey authored and jbphet committed May 26, 2020
1 parent 89a5df0 commit b133268
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/common/model/PointController.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ define( require => {
class PointController {

/**
* TODO: constructor changed: update all new PointController calls
* @param {Object} [options]
*/
constructor( options ) {
Expand Down Expand Up @@ -155,6 +154,16 @@ define( require => {
}
get controlledNumberLinePoint() { return this.getControlledNumberLinePoint(); }

/**
* gets the first controlled number line if it exists; null if otherwise
* @returns {NumberLine|null}
* @public
*/
getNumberLine() {
return ( this.numberLines.length > 0 )? this.numberLines[ 0 ] : null;
}
get numberLine() { return this.getNumberLine(); }

/**
* returns whether this point controller controls a number line point or is even associated with a number line point
* @returns {boolean}
Expand Down

0 comments on commit b133268

Please sign in to comment.