INNER CODE UNIT · JavaScript

File

Thorium-Sim/thorium · server/classes/computerCore/index.js:21

export class File {
  constructor(params = {}) {
    this.id = params.id || uuid.v4();
    this.name = params.name || `File ${Math.round(Math.random() * 998 + 1)}`;
    this.level = params.level || Math.round(Math.random() * 10 + 1);
    this.corrupted = params.corrupted || false;
    this.restoring = params.restoring || false;
  }
  corrupt() {
    this.corrupted = true;
  }
  restore() {
    this.restoring = true;
  }
  uncorrupt() {
    this.restoring = false;
    this.corrupted = false;
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…