<commit_before>/**
 * GenericTournamentView
 *
 * @return GenericTournamentView
 * @author <NAME> <<EMAIL>>
 * @license MIT License
 * @see LICENSE
 */
define(['lib/extend', 'core/view', 'ui/tournamentview', 'ui/roundtournamentview',
    'ui/swisstournamentview', 'ui/kotournamentview'], function(extend, View, //
TournamentView, RoundTournamentView, SwissTournamentView, KOTournamentView) {
  var constructors, defaultConstructor;

  constructors = {
    swiss: SwissTournamentView,
    round: RoundTournamentView,
    ko: KOTournamentView
  };

  defaultConstructor = TournamentView;

  /**
   * Constructor
   */
  function GenericTournamentView(tournament, $view, tournaments) {
    var Constructor;
    GenericTournamentView.superconstructor.call(this, undefined, $view);

    this.tournament = tournament;
    if (tournament) {
      Constructor = constructors[tournament.SYSTEM] || defaultConstructor;
      this.view = new Constructor(tournament, $view, tournaments);
    } else {
      this.view = new View(undefined, $view);
    }

    /*
     * Note: for some unknown reason, the prototype chain ignores
     * 'prototype.destroy'
     */
    this.destroy = GenericTournamentView.destroy;
  }
  extend(GenericTournamentView, View);

  GenericTournamentView.destroy = function() {
    this.view.destroy();
    GenericTournamentView.superclass.destroy.call(this);
  };

  return GenericTournamentView;
});<commit_msg>Add placement tournament to generictournamentview<commit_after>/**
 * GenericTournamentView
 *
 * @return GenericTournamentView
 * @author <NAME> <<EMAIL>>
 * @license MIT License
 * @see LICENSE
 */
define(['lib/extend', 'core/view', 'ui/tournamentview', 'ui/roundtournamentview',
  'ui/swisstournamentview', 'ui/kotournamentview', 'ui/placementtournamentview'],
  function (extend, View, TournamentView, RoundTournamentView, SwissTournamentView,
    KOTournamentView, PlacementTournamentView) {
    var constructors, defaultConstructor;

    constructors = {
      swiss: SwissTournamentView,
      round: RoundTournamentView,
      ko: KOTournamentView,
      placement: PlacementTournamentView
    };

    defaultConstructor = TournamentView;

    /**
     * Constructor
     */
    function GenericTournamentView(tournament, $view, tournaments) {
      var Constructor;
      GenericTournamentView.superconstructor.call(this, undefined, $view);

      this.tournament = tournament;
      if (tournament) {
        Constructor = constructors[tournament.SYSTEM] || defaultConstructor;
        this.view = new Constructor(tournament, $view, tournaments);
      } else {
        this.view = new View(undefined, $view);
      }

      /*
       * Note: for some unknown reason, the prototype chain ignores
       * 'prototype.destroy'
       */
      this.destroy = GenericTournamentView.destroy;
    }
    extend(GenericTournamentView, View);

    GenericTournamentView.destroy = function () {
      this.view.destroy();
      GenericTournamentView.superclass.destroy.call(this);
    };

    return GenericTournamentView;
  });
{'fraction_non_alphanumeric': 0.11165684348395546, 'fraction_numerical': 0.0, 'mean_word_length': 3.765990639625585, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2346522', 'n_tokens_mistral': 924, 'n_tokens_neox': 852, 'n_words': 175}