 ratings = require('./ratings')
 alts = require('./alts')
+
+INITIAL_RANGE = 100
+RANGE_INCREMENT = 100
 
 class QueuedPlayer
   constructor: (player) ->
     @player = player
-    @range = 100
+    @range = INITIAL_RANGE
     @rating = null  # needs to be updated by getRatings
 
   intersectsWith: (other) ->

          continue  unless @hasUserId(@newPlayers[i].player.id)
          @newPlayers[i].rating = rating

        @newPlayers = []  # reset the new players list, we're done
        next(null)

  # Returns an array of pairs. Each pair is a queue object that contains


  hasRecentlyMatched: (player1Id, player2Id) ->
    players = [player1Id, player2Id].sort()
    key = "#{players[0]}:#{players[1]}"
    @recentlyMatched[key]?

  addRecentMatch: (player1Id, player2Id) ->
    players = [player1Id, player2Id].sort()
    key = "#{players[0]}:#{players[1]}"
    @recentlyMatched[key] = true
    setTimeout((=> delete @recentlyMatched[key]), 30 * 60 * 1000) # expire in 30 minutes

