<commit_before>package me.elsiff.morefish.fishing.catcheffect

import me.elsiff.morefish.fishing.Fish
import org.bukkit.entity.Player

/**
 * Created by elsiff on 2018-12-25.
 */
class CatchEffectCollection {
    val effects = mutableListOf<CatchEffect>()

    fun addEffect(effect: CatchEffect) = effects.add(effect)

    fun removeEffect(effect: CatchEffect) {
        if (effect !in effects)
            throw IllegalStateException("Catch Effect doesn't exist")
        else
            effects.remove(effect)
    }

    fun playAll(catcher: Player, fish: Fish) {
        effects.forEach { it.play(catcher, fish) }
    }
}<commit_msg>Make effects of CatchEffectCollection immutable<commit_after>package me.elsiff.morefish.fishing.catcheffect

import me.elsiff.morefish.fishing.Fish
import org.bukkit.entity.Player

/**
 * Created by elsiff on 2018-12-25.
 */
class CatchEffectCollection {
    val effects: List<CatchEffect> = mutableListOf()

    fun addEffect(effect: CatchEffect) {
        effects as MutableList
        effects.add(effect)
    }

    fun removeEffect(effect: CatchEffect) {
        effects as MutableList
        if (effect !in effects)
            throw IllegalStateException("Catch Effect doesn't exist")
        else
            effects.remove(effect)
    }

    fun playAll(catcher: Player, fish: Fish) {
        effects.forEach { it.play(catcher, fish) }
    }
}
{'fraction_non_alphanumeric': 0.09784172661870504, 'fraction_numerical': 0.011510791366906475, 'mean_word_length': 3.0086455331412103, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '142828', 'n_tokens_mistral': 441, 'n_tokens_neox': 417, 'n_words': 95}