private Vector2 RandomEmpty(RoomControl room)
{
if (!IsNextToEmpty(room)) {
throw new System.InvalidOperationException("Can not give empty room if not next to empty");
}
Vector2 vect;
int d = 0;
do {
vect = RoomControl.vectors[UnityEngine.Random.Range(0, 4)];
if (d > 1000)
{
throw new System.Exception("Infinite loop occurring.");
}
d++;
} while (!IsEmpty(room.Index + vect));
return vect;
}