<commit_before>// Copyright 2020-2022, University of Colorado Boulder

/**
 * Model for the home screen.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PhET Interactive Simulations)
 */

import Property from '../../axon/js/Property.js';
import IntentionalAny from '../../phet-core/js/types/IntentionalAny.js';
import Tandem from '../../tandem/js/Tandem.js';
import joist from './joist.js';
import Screen from './Screen.js';
import ScreenView from './ScreenView.js';

class HomeScreenModel {
  public simScreens: Screen<IntentionalAny, ScreenView>[]; // screens in the simulations that are not the HomeScreen
  public screenProperty: Property<Screen<IntentionalAny, ScreenView>>;
  public selectedScreenProperty: Property<Screen<IntentionalAny, ScreenView>>;

  /**
   * @param screenProperty - the screen that is displayed to the user in the main area above the
   *                                           - navigation bar
   * @param simScreens
   * @param tandem
   */
  public constructor( screenProperty: Property<Screen<IntentionalAny, IntentionalAny>>, simScreens: Screen<IntentionalAny, IntentionalAny>[], tandem: Tandem ) {

    this.simScreens = simScreens;
    this.screenProperty = screenProperty;
    this.selectedScreenProperty = new Property( simScreens[ 0 ], {
      validValues: simScreens,
      phetioType: Property.PropertyIO( Screen.ScreenIO ),
      tandem: tandem.createTandem( 'selectedScreenProperty' ),
      phetioFeatured: true
    } );

    // the correct screen icon is selected when returning to the home screen
    this.screenProperty.link( screen => {
      if ( _.includes( simScreens, screen ) ) {
        this.selectedScreenProperty.value = screen;
      }
    } );
  }

  public step(): void { /* no stepping here */ }
}

joist.register( 'HomeScreenModel', HomeScreenModel );

export default HomeScreenModel;<commit_msg>Add dt to step function, see https://github.com/phetsims/joist/issues/783<commit_after>// Copyright 2020-2022, University of Colorado Boulder

/**
 * Model for the home screen.
 *
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PhET Interactive Simulations)
 * @author <NAME> (PhET Interactive Simulations)
 */

import Property from '../../axon/js/Property.js';
import IntentionalAny from '../../phet-core/js/types/IntentionalAny.js';
import Tandem from '../../tandem/js/Tandem.js';
import joist from './joist.js';
import Screen from './Screen.js';
import ScreenView from './ScreenView.js';

class HomeScreenModel {
  public simScreens: Screen<IntentionalAny, ScreenView>[]; // screens in the simulations that are not the HomeScreen
  public screenProperty: Property<Screen<IntentionalAny, ScreenView>>;
  public selectedScreenProperty: Property<Screen<IntentionalAny, ScreenView>>;

  /**
   * @param screenProperty - the screen that is displayed to the user in the main area above the
   *                                           - navigation bar
   * @param simScreens
   * @param tandem
   */
  public constructor( screenProperty: Property<Screen<IntentionalAny, IntentionalAny>>, simScreens: Screen<IntentionalAny, IntentionalAny>[], tandem: Tandem ) {

    this.simScreens = simScreens;
    this.screenProperty = screenProperty;
    this.selectedScreenProperty = new Property( simScreens[ 0 ], {
      validValues: simScreens,
      phetioType: Property.PropertyIO( Screen.ScreenIO ),
      tandem: tandem.createTandem( 'selectedScreenProperty' ),
      phetioFeatured: true
    } );

    // the correct screen icon is selected when returning to the home screen
    this.screenProperty.link( screen => {
      if ( _.includes( simScreens, screen ) ) {
        this.selectedScreenProperty.value = screen;
      }
    } );
  }

  public step( dt: number ): void { /* no stepping here */ }
}

joist.register( 'HomeScreenModel', HomeScreenModel );

export default HomeScreenModel;
{'fraction_non_alphanumeric': 0.11382113821138211, 'fraction_numerical': 0.005335365853658537, 'mean_word_length': 3.530494821634062, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7209587', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1073, 'n_words': 321}