<commit_before>import Controller from './Controller'

/**
 * Controller that has multiple different content creators it can switch between
 */
export default class MulticontentController extends Controller {
  constructor ({ game, style, menuView, contents, startIndex }) {
    super(game, style, menuView)

    this.contents = contents
    for (let content of this.contents) {
      content.setOwner(this)
    }

    this.startIndex = (startIndex != null ? startIndex : 0)
    this.index = this.startIndex

    this.getStack = []
  }

  /**
   * Draws the section with the currently chosen content creator. If user has
   * moved to the current content from some other content, "Back"-button is
   * created
   */
  createSections () {
    this.contents[this.index].createSections()

    if (this.getStack.length > 0) {
      this.section('back')
      this.button('Takaisin', this.previousContent, this)
    }
  }

  /**
   * The content creator currently active
   */
  current () {
    return this.contents[this.index]
  }<commit_msg>bugi, yritän fiksaa<commit_after>import Controller from './Controller'

/**
 * Controller that has multiple different content creators it can switch between
 */
export default class MulticontentController extends Controller {
  constructor ({ game, style, menuView, contents, startIndex }) {
    super(game, style, menuView)

    this.contents = contents
    for (let content of this.contents) {
      content.setOwner(this)
    }

    this.startIndex = (startIndex != null ? startIndex : 0)
    this.index = this.startIndex

    this.getStack = []
  }

  /**
   * Draws the section with the currently chosen content creator. If user has
   * moved to the current content from some other content, "Back"-button is
   * created
   */
  createSections () {
    this.contents[this.index].createSections()
  
    // bugi
    //


    //

    
    console.log(this.getStack)
    if (this.getStack.length > 0 ) {
      this.section('back')
      this.button('Takaisin', this.previousContent, this)
    }
    if (this.getStack.length > 1) {
      this.getStack.pop()
    }
  }

  /**
   * The content creator currently active
   */
  current () {
    return this.contents[this.index]
  }
{'fraction_non_alphanumeric': 0.11000901713255185, 'fraction_numerical': 0.002254283137962128, 'mean_word_length': 2.8658536585365852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1082218', 'n_tokens_mistral': 659, 'n_tokens_neox': 631, 'n_words': 182}