FunGame-Core/Library/Common/Event/RoomEventArgs.cs
milimoe 082ce3b6f5
添加插件加载器和事件触发方法组 (#54)
* Add PluginLoader

* 删除event返回值

* 添加插件触发器(方法组)

* 删除冗余方法

* 将typeof(GetType())改写为this is

* 删除无用引用
2023-09-24 13:06:10 +08:00

38 lines
1.3 KiB
C#

using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Core.Library.Common.Event
{
public class RoomEventArgs : GeneralEventArgs
{
public string RoomID { get; set; } = "";
public long RoomMaster { get; set; } = 0;
public RoomType RoomType { get; set; } = RoomType.All;
public RoomState RoomState { get; set; } = RoomState.Created;
public bool HasPassword => Password.Trim() != "";
public string Password { get; set; } = "";
public RoomEventArgs(string RoomType, string Password)
{
this.RoomType = RoomType switch
{
GameMode.GameMode_Mix => Constant.RoomType.Mix,
GameMode.GameMode_Team => Constant.RoomType.Team,
GameMode.GameMode_MixHasPass => Constant.RoomType.MixHasPass,
GameMode.GameMode_TeamHasPass => Constant.RoomType.TeamHasPass,
_ => Constant.RoomType.All
};
this.Password = Password;
}
public RoomEventArgs(Room Room)
{
RoomID = Room.Roomid;
RoomMaster = Room.RoomMaster != null ? Room.RoomMaster.Id : 0;
RoomType = Room.RoomType;
RoomState = Room.RoomState;
Password = Room.Password;
}
}
}