Skip to content

Commit

Permalink
create Tandem.GENERAL_CONTROLLER and use it in globalKeyStateTracker, p…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Dec 3, 2020
1 parent 513c70f commit 8079a02
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
26 changes: 18 additions & 8 deletions js/PhetioIDUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
const HOME_SCREEN_COMPONENT_NAME = 'homeScreen';
const MODEL_COMPONENT_NAME = 'model';
const VIEW_COMPONENT_NAME = 'view';
const CONTROLLER_COMPONENT_NAME = 'controller';

/**
* Helpful methods for manipulating phetioIDs. Used to minimize the amount of duplicated logic specific to the string
Expand Down Expand Up @@ -186,7 +187,7 @@
// Private Doc: The below jsdoc is public to the phet-io api documentation. Change wisely.
/**
* The separator used to piece together a phet-io ID.
* @type {String}
* @type {string}
* @constant
* @public
*/
Expand All @@ -195,7 +196,7 @@
// Private Doc: The below jsdoc is public to the phet-io api documentation. Change wisely.
/**
* The separator used to specify the count of a element in a group.
* @type {String}
* @type {string}
* @constant
* @public
*/
Expand All @@ -204,7 +205,7 @@
// Private Doc: The below jsdoc is public to the phet-io api documentation. Change wisely.
/**
* The component name for the id section that holds phet-io elements general to all simulations.
* @type {String}
* @type {string}
* @constant
* @public
*/
Expand All @@ -213,7 +214,7 @@
// Private Doc: The below jsdoc is public to the phet-io api documentation. Change wisely.
/**
* The component name for the id section that holds simulation specific elements that don't belong in a screen.
* @type {String}
* @type {string}
* @constant
* @public
*/
Expand All @@ -222,7 +223,7 @@
// Private Doc: The below jsdoc is public to the phet-io api documentation. Change wisely.
/**
* The component name for the id section that holds the home screen.
* @type {String}
* @type {string}
* @constant
* @public
*/
Expand All @@ -231,7 +232,7 @@
// Private Doc: The below jsdoc is public to the phet-io api documentation. Change wisely.
/**
* The component name for an id section that holds model specific elements.
* @type {String}
* @type {string}
* @constant
* @public
*/
Expand All @@ -240,10 +241,19 @@
// Private Doc: The below jsdoc is public to the phet-io api documentation. Change wisely.
/**
* The component name for an id section that holds view specific elements.
* @type {String}
* @type {string}
* @constant
* @public
*/
VIEW_COMPONENT_NAME: VIEW_COMPONENT_NAME
VIEW_COMPONENT_NAME: VIEW_COMPONENT_NAME,

// Private Doc: The below jsdoc is public to the phet-io api documentation. Change wisely.
/**
* The component name for an id section that holds controller specific elements.
* @type {string}
* @constant
* @public
*/
CONTROLLER_COMPONENT_NAME: CONTROLLER_COMPONENT_NAME
};
} )();
9 changes: 9 additions & 0 deletions js/Tandem.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,15 @@ Tandem.GENERAL_MODEL = Tandem.GENERAL.createTandem( window.phetio.PhetioIDUtils.
*/
Tandem.GENERAL_VIEW = Tandem.GENERAL.createTandem( window.phetio.PhetioIDUtils.VIEW_COMPONENT_NAME );

/**
* Tandem for controller simulation elements that are general to all sims.
*
* @public
* @constant
* @type {Tandem}
*/
Tandem.GENERAL_CONTROLLER = Tandem.GENERAL.createTandem( window.phetio.PhetioIDUtils.CONTROLLER_COMPONENT_NAME );

/**
* Simulation elements that don't belong in screens should be nested under "global". Note that this tandem should only
* have simulation specific elements in them. Instrument items used by all sims under `Tandem.GENERAL`. Most
Expand Down

0 comments on commit 8079a02

Please sign in to comment.