package main

import (
	"sync"
//	"time"
)

var rooms []*Room
var roomsLock sync.Mutex

/*func ProcessRooms() {
	for {
		roomsLock.Lock()

		var newRooms []*Room

		for _, room := range rooms {
			if room.IsClosed || len(room.Players) == 0 {
				continue
			}

			newRooms = append(newRooms, room)

			room.Process(time.Now().UnixNano() / int64(time.Millisecond))
			room.SendData(time.Now().UnixNano() / int64(time.Millisecond))
		}

		rooms = newRooms
		roomsLock.Unlock()

		time.Sleep(1 * time.Millisecond)
	}
}*/
