From 08670173ebea4eb5f55243d4eb045b462b42a863 Mon Sep 17 00:00:00 2001 From: milimoe Date: Tue, 14 Nov 2023 00:31:21 +0800 Subject: [PATCH] RoomList : IEnumerable --- Model/RoomList.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Model/RoomList.cs b/Model/RoomList.cs index 922cf8f..39b123d 100644 --- a/Model/RoomList.cs +++ b/Model/RoomList.cs @@ -4,7 +4,7 @@ using Milimoe.FunGame.Core.Library.Constant; namespace Milimoe.FunGame.Core.Model { - public class RoomList : IEnumerable + public class RoomList : IEnumerable { private readonly Dictionary _List = new(); private readonly Dictionary> _PlayerList = new(); @@ -93,5 +93,13 @@ namespace Milimoe.FunGame.Core.Model yield return room; } } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (Room room in ListRoom) + { + yield return room; + } + } } }