<commit_before>'use strict';

function PlayerSoundEmitter(args) {
  if(!(this instanceof PlayerSoundEmitter))
    return new PlayerSoundEmitter(args);

  this.audioContext = args.audioContext;

  this.startAudioElement = args.startAudioElement;
  this.startAudioNode = this.audioContext.createMediaElementSource(this.startAudioElement);
  this.startAudioNode.connect(this.audioContext.destination);

  this.warpAudioElement = args.warpAudioElement;
  this.warpAudioNode = this.audioContext.createMediaElementSource(this.warpAudioElement);
  this.warpAudioNode.connect(this.audioContext.destination);

  this.playedStartSound = false;
}

PlayerSoundEmitter.prototype = GameplayObject();

PlayerSoundEmitter.prototype.draw = function() {}

PlayerSoundEmitter.prototype.beginObservingPlayer = function(player) {
  player.addMovementObserver(this);
  player.addWarpObserver(this);
}

PlayerSoundEmitter.prototype.afterPlayerMoved = function(player) {
  if(!this.playedStartSound) {
    this.startAudioElement.play();
    this.playedStartSound = true;
  }
}

PlayerSoundEmitter.prototype.afterPlayerWarped = function(player) {
  this.warpAudioElement.play();
}<commit_msg>removed needless arguments in PlayerSoundEmitter methods<commit_after>'use strict';

function PlayerSoundEmitter(args) {
  if(!(this instanceof PlayerSoundEmitter))
    return new PlayerSoundEmitter(args);

  this.audioContext = args.audioContext;

  this.startAudioElement = args.startAudioElement;
  this.startAudioNode = this.audioContext.createMediaElementSource(this.startAudioElement);
  this.startAudioNode.connect(this.audioContext.destination);

  this.warpAudioElement = args.warpAudioElement;
  this.warpAudioNode = this.audioContext.createMediaElementSource(this.warpAudioElement);
  this.warpAudioNode.connect(this.audioContext.destination);

  this.playedStartSound = false;
}

PlayerSoundEmitter.prototype = GameplayObject();

PlayerSoundEmitter.prototype.draw = function() {}

PlayerSoundEmitter.prototype.beginObservingPlayer = function(player) {
  player.addMovementObserver(this);
  player.addWarpObserver(this);
}

PlayerSoundEmitter.prototype.afterPlayerMoved = function() {
  if(!this.playedStartSound) {
    this.startAudioElement.play();
    this.playedStartSound = true;
  }
}

PlayerSoundEmitter.prototype.afterPlayerWarped = function() {
  this.warpAudioElement.play();
}
{'fraction_non_alphanumeric': 0.1040169133192389, 'fraction_numerical': 0.0, 'mean_word_length': 6.583333333333333, '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': '4125820', 'n_tokens_mistral': 685, 'n_tokens_neox': 689, 'n_words': 87}