<commit_before>import Vector from './Vector';
import * as Main from './Main';
import ParticleSystem from "./ParticleSystem";
import Tint from "./Tint";
import {CursorMode, RotationMode} from "./Modes";
import {getRandomAngle} from "./Utils";
import {PSOptionInterface} from "./PSOptionInterface";

export default class Particle {
    public readonly defaultRotation: number;
    public readonly defaultWidth: number;
    public readonly defaultHeight: number;
    public readonly defaultSpeed: number;
    public readonly defaultVelocity: Vector;
    public position: Vector;
    public velocity: Vector;
    public width: number;
    public height: number;

    private particleSystem: ParticleSystem;
    private image: HTMLImageElement;
    private rotation: number; // degrés
    private rotationSpeed: number;
    private alive: boolean = true;

    private tint: Tint;
    private buffer: HTMLCanvasElement;
    private psOptions: PSOptionInterface;

    constructor(particleSystem: ParticleSystem, x: number, y: number, image: HTMLImageElement) {
        this.particleSystem = particleSystem;
        this.psOptions = particleSystem.options;
        let randomSize = Math.random();
        this.defaultWidth = this.psOptions.width[0] + randomSize * this.psOptions.width[1];
        this.defaultHeight = this.psOptions.height[0] + randomSize * this.psOptions.height[1];
        this.defaultSpeed = this.psOptions.speed[0] + Math.random() * (this.psOptions.speed[1] - this.psOptions.speed[0]);
        this.width = this.defaultWidth;
        this.height = this.defaultHeight;
        this.position = new Vector(x, y);
        this.velocity = new Vector(0, 0);
        this.setRandomVelocity();
        this.defaultVelocity = this.velocity.cpy();
        this.defaultRotation = getRandomAngle(this.psOptions.rotationStartAngle[0], this.psOptions.rotationStartAngle[1]);
        this.rotation = this.defaultRotation;
        this.rotationSpeed = 6 - randomSize * 5.5; // TODO configurable
        this.image = image;

        // offscreen buffer
<commit_msg>npm run build minify<commit_after>import Vector from './Vector';
import * as Main from './Main';
import ParticleSystem from "./ParticleSystem";
import Tint from "./Tint";
import {CursorMode, RotationMode} from "./Modes";
import {getRandomAngle} from "./Utils";
import {PSOptionInterface} from "./PSOptionInterface";

export default class Particle {
    public readonly defaultRotation: number;
    public readonly defaultWidth: number;
    public readonly defaultHeight: number;
    public readonly defaultSpeed: number;
    public readonly defaultVelocity: Vector;
    public position: Vector;
    public velocity: Vector;
    public width: number;
    public height: number;

    private particleSystem: ParticleSystem;
    private image: HTMLImageElement;
    private rotation: number; // degrés
    private rotationSpeed: number;
    private alive: boolean = true;

    private tint: Tint;
    private buffer: HTMLCanvasElement;
    private psOptions: PSOptionInterface;

    constructor(particleSystem: ParticleSystem, x: number, y: number, image: HTMLImageElement) {
        this.particleSystem = particleSystem;
        this.psOptions = particleSystem.options;
        let randomSize = Math.random();
        this.defaultWidth = this.psOptions.width[0] + randomSize * this.psOptions.width[1];
        this.defaultHeight = this.psOptions.height[0] + randomSize * this.psOptions.height[1];
        this.defaultSpeed = this.psOptions.speed[0] + Math.random() * (this.psOptions.speed[1] - this.psOptions.speed[0]);
        this.width = this.defaultWidth;
        this.height = this.defaultHeight;
        this.position = new Vector(x, y);
        this.velocity = new Vector(0, 0);
        this.setRandomVelocity();
        this.defaultVelocity = this.velocity.cpy();
        this.defaultRotation = getRandomAngle(this.psOptions.rotationStartAngle[0], this.psOptions.rotationStartAngle[1]);
        this.rotation = this.defaultRotation;
        this.rotationSpeed = 6 - randomSize * 5.5; // TODO configurable
        this.image = image;

        // offscreen buffer
{'fraction_non_alphanumeric': 0.10513565891472869, 'fraction_numerical': 0.006782945736434108, 'mean_word_length': 3.4929270946681177, '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': '1149911', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1099, 'n_words': 303}