From 3290278df4d4034285da2735b6415bd1027059f5 Mon Sep 17 00:00:00 2001 From: milimoe Date: Sun, 10 Dec 2023 23:56:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9RoomEventArgs=E6=9E=84?= =?UTF-8?q?=E9=80=A0=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Common/Event/RoomEventArgs.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Library/Common/Event/RoomEventArgs.cs b/Library/Common/Event/RoomEventArgs.cs index 273aff9..c197bab 100644 --- a/Library/Common/Event/RoomEventArgs.cs +++ b/Library/Common/Event/RoomEventArgs.cs @@ -9,25 +9,18 @@ namespace Milimoe.FunGame.Core.Library.Common.Event public Room Room { get; set; } = General.HallInstance; public string RoomID { get; set; } = ""; public long RoomMaster { get; set; } = 0; - public string RoomTypeString { get; set; } = RoomSet.All; public RoomType RoomType { get; set; } = RoomType.All; + public string RoomTypeString { get; set; } = RoomSet.All; public string GameMode { get; set; } = ""; public string GameMap { get; set; } = ""; public RoomState RoomState { get; set; } = RoomState.Created; public bool HasPassword => Password.Trim() != ""; public string Password { get; set; } = ""; - public RoomEventArgs(string type, string password) + public RoomEventArgs(RoomType type, string password) { - RoomTypeString = type; - RoomType = type switch - { - RoomSet.Mix => RoomType.Mix, - RoomSet.Team => RoomType.Team, - RoomSet.FastAuto => RoomType.FastAuto, - RoomSet.Custom => RoomType.Custom, - _ => RoomType.All - }; + RoomType = type; + RoomTypeString = RoomSet.GetTypeString(type); Password = password; Room = Factory.GetRoom(RoomType: RoomType, Password: Password); }