<commit_before>TurnOrder = Ember.Object.extend
    participants: null

    init: ->
        Ember.assert "turn-order requires participants array", @participants
        Ember.assert("turn-order requires battleStats.speed", pokemon.battleStats.speed?) for pokemon in @participants

`export default TurnOrder`
<commit_msg>set up internal data for calculating turns<commit_after>TurnOrder = Ember.Object.extend
    participants: null

    nextTwentyTurns: Ember.computed -> []

    whoIsNext: ->
        null

    nextTurn: ->
        null

    init: ->
        Ember.assert "turn-order requires participants array", @participants
        Ember.assert("turn-order requires battleStats.speed", pokemon.battleStats.speed?) for pokemon in @participants

        @_generateInternalData()
        @_sortBySpeed()
        @_calculateMultipliers()
        debugger

    _generateInternalData: ->
        @_participants = ({pokemon} for pokemon in @participants)

    _sortBySpeed: ->
        @_participants = _.sortBy @_participants, (p) ->
            -p.pokemon.battleStats.speed

    _calculateMultipliers: ->
        fastestParticipant = _.max @_participants, (p) ->
            p.pokemon.battleStats.speed

        maxSpeed = fastestParticipant.pokemon.battleStats.speed

        _.each @_participants, (p) ->
            p.multiplier = maxSpeed / p.pokemon.battleStats.speed
            p.currentFrame = 0






`export default TurnOrder`

{'fraction_non_alphanumeric': 0.0975609756097561, 'fraction_numerical': 0.0006968641114982578, 'mean_word_length': 2.7202072538860103, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '4710990', 'n_tokens_mistral': 438, 'n_tokens_neox': 413, 'n_words': 89}