addToOldestWaiting() {
    let lobbies = this.getWaitingLobbies()
    let player = this.waitingPlayers.shift()
    if (lobbies.length > 0) {
      // there were waiting lobbies
      let oldest = {time: new Date()}
      lobbies.forEach(l => {
        if (l.time < oldest.time) {
          oldest = l
        }
      })
      return this.addPlayerToLobby(oldest.id, player.name, player.socketId)
    } else {
      // no waiting lobbies
      const lob = this.newLobby()
      return this.addPlayerToLobby(lob.id, player.name, player.socketId)
    }
  }
/**
   * adds the first person in the waitlist to the oldest lobby
   * - will make new lobbies if there are none
   * - only adds to public lobbies
   */
adds the first person in the waitlist to the oldest lobby
- will make new lobbies if there are none
- only adds to public lobbies
adds the first person in the waitlist to the oldest lobby - will make new lobbies if there are none - only adds to public lobbies
addToOldestWaiting() {
    let lobbies = this.getWaitingLobbies()
    let player = this.waitingPlayers.shift()
    if (lobbies.length > 0) {
      let oldest = {time: new Date()}
      lobbies.forEach(l => {
        if (l.time < oldest.time) {
          oldest = l
        }
      })
      return this.addPlayerToLobby(oldest.id, player.name, player.socketId)
    } else {
      const lob = this.newLobby()
      return this.addPlayerToLobby(lob.id, player.name, player.socketId)
    }
  }
addToOldestWaiting ( ) { let lobbies = this . getWaitingLobbies ( ) let player = this . waitingPlayers . shift ( ) if ( lobbies . length > 0 ) { let oldest = { time : new Date ( ) } lobbies . forEach ( l => { if ( l . time < oldest . time ) { oldest = l } } ) return this . addPlayerToLobby ( oldest . id , player . name , player . socketId ) } else { const lob = this . newLobby ( ) return this . addPlayerToLobby ( lob . id , player . name , player . socketId ) } }
adds the first person in the waitlist to the oldest lobby
 - will make new lobbies if there are none
 - only adds to public lobbies
adds the first person in the waitlist to the oldest lobby - will make new lobbies if there are none - only adds to public lobbies
// there were waiting lobbies // no waiting lobbies