RoomList : IEnumerable<Room>

This commit is contained in:
milimoe 2023-11-14 00:31:21 +08:00
parent 84a0b231c4
commit 08670173eb
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E

View File

@ -4,7 +4,7 @@ using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Core.Model namespace Milimoe.FunGame.Core.Model
{ {
public class RoomList : IEnumerable public class RoomList : IEnumerable<Room>
{ {
private readonly Dictionary<string, Room> _List = new(); private readonly Dictionary<string, Room> _List = new();
private readonly Dictionary<string, List<User>> _PlayerList = new(); private readonly Dictionary<string, List<User>> _PlayerList = new();
@ -93,5 +93,13 @@ namespace Milimoe.FunGame.Core.Model
yield return room; yield return room;
} }
} }
IEnumerator<Room> IEnumerable<Room>.GetEnumerator()
{
foreach (Room room in ListRoom)
{
yield return room;
}
}
} }
} }