Automatic room closing (#6)
* Ace now lets you play again if there are two players * 1 line if :o * Better Ace * Feature/automautic room closing (#5) * Room now closes when nobody is in the room * cleanup
This commit is contained in:
@@ -7,7 +7,7 @@ public class RoomManager : IRoomManager
|
||||
public string CreateRoom()
|
||||
{
|
||||
var roomId = Guid.NewGuid().ToString();
|
||||
var room = new Room();
|
||||
var room = new Room(this, roomId);
|
||||
Rooms.Add(roomId, room);
|
||||
return roomId;
|
||||
}
|
||||
@@ -31,14 +31,6 @@ public class RoomManager : IRoomManager
|
||||
{
|
||||
return Rooms.ContainsKey(roomId);
|
||||
}
|
||||
|
||||
public void RemoveAllRooms()
|
||||
{
|
||||
foreach (var room in Rooms.Where(room => room.Value.IsEmpty()))
|
||||
{
|
||||
Rooms.Remove(room.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface IRoomManager
|
||||
@@ -48,5 +40,4 @@ public interface IRoomManager
|
||||
public List<string> GetAllRooms();
|
||||
public void RemoveRoom(string roomId);
|
||||
public bool RoomExists(string roomId);
|
||||
public void RemoveAllRooms();
|
||||
}
|
||||
Reference in New Issue
Block a user