diff --git a/Entity/Statistics/GameStatistics.cs b/Entity/Statistics/GameStatistics.cs index 79fe591..c748779 100644 --- a/Entity/Statistics/GameStatistics.cs +++ b/Entity/Statistics/GameStatistics.cs @@ -1,11 +1,9 @@ -using Milimoe.FunGame.Core.Library.Constant; - -namespace Milimoe.FunGame.Core.Entity +namespace Milimoe.FunGame.Core.Entity { public class GameStatistics { public long Id => Room.Id; - public Room Room { get; set; } = General.HallInstance; + public Room Room { get; } public DateTime RecordTime { get; set; } = DateTime.Now; public string Record { get; set; } = ""; public Dictionary DamageStats { get; set; } = new(); @@ -68,5 +66,10 @@ namespace Milimoe.FunGame.Core.Entity public Dictionary RatingStats { get; } = new(); // 结算后的Rating public Dictionary EloStats { get; } = new(); // Elo分数变化(+/-) public Dictionary RankStats { get; } = new(); // 结算后的Rank(非比赛前) + + public GameStatistics(Room Room) + { + this.Room = Room; + } } } diff --git a/Entity/System/Room.cs b/Entity/System/Room.cs index 4c49743..6a227c2 100644 --- a/Entity/System/Room.cs +++ b/Entity/System/Room.cs @@ -14,11 +14,11 @@ namespace Milimoe.FunGame.Core.Entity public RoomState RoomState { get; set; } public bool HasPass => Password.Trim() != ""; public string Password { get; set; } = ""; - public GameStatistics Statistics { get; set; } = new(); + public GameStatistics Statistics { get; set; } internal Room() { - + Statistics = new(this); } internal Room(long Id = 0, string Roomid = "-1", DateTime? CreateTime = null, User? RoomMaster = null, RoomType RoomType = RoomType.All, RoomState RoomState = RoomState.Created, string Password = "") @@ -30,6 +30,7 @@ namespace Milimoe.FunGame.Core.Entity this.RoomType = RoomType; this.RoomState = RoomState; this.Password = Password; + Statistics = new(this); } public bool Equals(Room other)