 
     getArrangements: ->
       for playerId in @playerIds
-        console.log @arranging, @arranged
         @arranged[playerId] || [0...@getTeam(playerId).length]

      @arranged = {}

    start: ->
      if @arranging
        @tell(Protocol.TEAM_PREVIEW)
        @shouldStart = false
      else
        @tell(Protocol.REARRANGE_TEAMS, @getArrangements()...)
        @shouldStart = true

  extendFacade:
    arrangeTeam: (playerId, arrangement) ->

        return false  if !team.pokemon[index]
        return false  if arrangement.indexOf(index, i + 1) != -1
      if @battle.arrangeTeam(playerId, arrangement)
        @arranging = false
        @battle.tell(Protocol.REARRANGE_TEAMS, @battle.getArrangements()...)
        @battle.startBattle()
        @battle.sendUpdates()
      return true
