<commit_before>import { Bar } from './bar';

import { QuantityRange } from './ranges';

import * as PhaserObjects from '../phaserObjects';

/**
  * Bar that adjusts the size of a static sprite based on a value.
  * This is done by masking the sprite and then resizing the mask.
  * @extends Bar
  */
export class QuantityBar extends Bar {
    /**
     * @param {Object} game - Current game instance.
     * @param {Object} xy -  Dictionary with the values for the bar's x and y position.
     * @param {Object} values - The numerical values for the bar.
     * @param {boolean} vertical - Determines if the bar should be vertical or horizontal.
     * @param {boolean} reverse - Determines the direction the bar moves when adjusted.
     * @param {string} trackImage - The image key to use for the track.
     * @param {string} barImage - The image key to use for the bar. Will automatically resize to fit.
     * @param {Object} tweenParams - Object with duration and easing function for the scrolling tween.
     */
    constructor(game, xy, values, vertical, reverse, trackImage, barImage, tweenParams) {
        super(game, xy.x, xy.y);

        this.valueRange = new QuantityRange(
            this,
            values.startValue,
            values.maxValue,
        );

        this.vertical = vertical || false;
        this.reverse = reverse || false;

        this.trackImage = trackImage;
        this.barImage = barImage;

        this.tweenParams = tweenParams || { duration: 300, ease: PhaserObjects.Easing.Quadratic.Out };

        // The track is the static area the bar will move along.
        this.track = this.game.add.sprite(0, 0, this.trackImage);
        this.add(this.track);

        // The bar is a static image taking up the width of the track.
        this.bar = new PhaserObjects.Button(
            game,
            0,
            0,
            this.barImage,
            this.moveContent,
            this,
            1,
            0,
        );
        this.add(this.bar);

        this.create();
    }

    /**
     * @private<commit_msg>quantitybar's bar should be a sprite, not button<commit_after>import { Bar } from './bar';

import { QuantityRange } from './ranges';

import * as PhaserObjects from '../phaserObjects';

/**
  * Bar that adjusts the size of a static sprite based on a value.
  * This is done by masking the sprite and then resizing the mask.
  * @extends Bar
  */
export class QuantityBar extends Bar {
    /**
     * @param {Object} game - Current game instance.
     * @param {Object} xy -  Dictionary with the values for the bar's x and y position.
     * @param {Object} values - The numerical values for the bar.
     * @param {boolean} vertical - Determines if the bar should be vertical or horizontal.
     * @param {boolean} reverse - Determines the direction the bar moves when adjusted.
     * @param {string} trackImage - The image key to use for the track.
     * @param {string} barImage - The image key to use for the bar. Will automatically resize to fit.
     * @param {Object} tweenParams - Object with duration and easing function for the scrolling tween.
     */
    constructor(game, xy, values, vertical, reverse, trackImage, barImage, tweenParams) {
        super(game, xy.x, xy.y);

        this.valueRange = new QuantityRange(
            this,
            values.startValue,
            values.maxValue,
        );

        this.vertical = vertical || false;
        this.reverse = reverse || false;

        this.trackImage = trackImage;
        this.barImage = barImage;

        this.tweenParams = tweenParams || { duration: 300, ease: PhaserObjects.Easing.Quadratic.Out };

        // The track is the static area the bar will move along.
        this.track = new PhaserObjects.Sprite(game, 0, 0, this.trackImage);
        this.add(this.track);

        // The bar is a static image taking up the width of the track.
        this.bar = new PhaserObjects.Sprite(
            game,
            0,
            0,
            this.barImage,
        );
        this.add(this.bar);

        this.create();
    }

    /**
     * @private
{'fraction_non_alphanumeric': 0.09618654359970853, 'fraction_numerical': 0.0038863249939276173, 'mean_word_length': 2.170130869899923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5595297', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1129, 'n_words': 430}