2025-11-16 19:16:44 +08:00

39 lines
1.2 KiB
C#

using CGamesServer.Api.Enums;
using MessagePack;
namespace CGamesServer.Api.Dto
{
[MessagePackObject]
public class RoomInfoResult : RoomInfo
{
[Key("enterRoomResult")]
public EnterRoomResult? EnterRoomResult { get; set; }
public static RoomInfoResult FromRoomInfo(RoomInfo roomInfo)
{
RoomInfoResult infoResult = new RoomInfoResult
{
AICount = roomInfo.AICount,
CoolDownMs = roomInfo.CoolDownMs,
CreateTimeMs = roomInfo.CreateTimeMs,
InitHostPlayerID = roomInfo.InitHostPlayerID,
IsStartGame = roomInfo.IsStartGame,
MapID = roomInfo.MapID,
MaxUserCount = roomInfo.MaxUserCount,
RandomSeed = roomInfo.RandomSeed,
RoomID = roomInfo.RoomID,
RoomName = roomInfo.RoomName,
RoomPwd = roomInfo.RoomPwd,
Sets = roomInfo.Sets,
UIdList = roomInfo.UIdList,
UserCount = roomInfo.UserCount,
RoomImageUrl = roomInfo.RoomImageUrl
};
return infoResult;
}
}
}