diff --git a/Entity/Statistics/GameStatistics.cs b/Entity/Statistics/GameStatistics.cs index 379a287..8bc6688 100644 --- a/Entity/Statistics/GameStatistics.cs +++ b/Entity/Statistics/GameStatistics.cs @@ -1,25 +1,28 @@ -using System.Collections; +using Milimoe.FunGame.Core.Library.Constant; namespace Milimoe.FunGame.Core.Entity { public class GameStatistics { - public int Id { get; set; } - public Room? Room { get; set; } = null; - public string? GameRecord { get; set; } = null; - public string? RunTime { get; set; } = null; - public Hashtable? DamageStats { get; set; } = new Hashtable(); - public Hashtable? PhysicalDamageStats { get; set; } = new Hashtable(); - public Hashtable? MagicDamageStats { get; set; } = new Hashtable(); - public Hashtable? RealDamageStats { get; set; } = new Hashtable(); - public Hashtable? AvgDamageStats { get; set; } = new Hashtable(); - public Hashtable? KillStats { get; set; } = new Hashtable(); - public Hashtable? KillDetailStats { get; set; } = new Hashtable(); - public Hashtable? DeathStats { get; set; } = new Hashtable(); - public Hashtable? DeathDetailStats { get; set; } = new Hashtable(); - public Hashtable? AssistStats { get; set; } = new Hashtable(); - public Hashtable? RatingStats { get; set; } = new Hashtable(); - public Hashtable? EloStats { get; set; } = new Hashtable(); - public Hashtable? RankStats { get; set; } = new Hashtable(); + public long Id => Room.Id; + public Room Room { get; set; } = General.HallInstance; + public DateTime RecordTime { get; set; } = DateTime.Now; + public string Record { get; set; } = ""; + public Dictionary DamageStats { get; set; } = new(); + public Dictionary PhysicalDamageStats { get; } = new(); + public Dictionary MagicDamageStats { get; } = new(); + public Dictionary RealDamageStats { get; } = new(); + public Dictionary AvgDamageStats { get; } = new(); + public Dictionary AvgPhysicalDamageStats { get; } = new(); + public Dictionary AvgMagicDamageStats { get; } = new(); + public Dictionary AvgRealDamageStats { get; } = new(); + public Dictionary KillStats { get; } = new(); + public Dictionary> KillDetailStats { get; } = new(); // 子字典记录的是被击杀者以及被击杀次数 + public Dictionary DeathStats { get; } = new(); + public Dictionary> DeathDetailStats { get; } = new(); // 子字典记录的是击杀者以及击杀次数 + public Dictionary AssistStats { get; } = new(); + public Dictionary RatingStats { get; } = new(); // 结算后的Rating + public Dictionary EloStats { get; } = new(); // Elo分数变化(+/-) + public Dictionary RankStats { get; } = new(); // 结算后的Rank(非比赛前) } } diff --git a/Entity/Statistics/UserStatistics.cs b/Entity/Statistics/UserStatistics.cs index 306aa74..29a8302 100644 --- a/Entity/Statistics/UserStatistics.cs +++ b/Entity/Statistics/UserStatistics.cs @@ -8,10 +8,10 @@ namespace Milimoe.FunGame.Core.Entity { public long Id => User.Id; public User User { get; } - public Dictionary DamageStats { get; set; } = new(); - public Dictionary PhysicalDamageStats { get; set; } = new(); - public Dictionary MagicDamageStats { get; set; } = new(); - public Dictionary RealDamageStats { get; set; } = new(); + public Dictionary DamageStats { get; } = new(); + public Dictionary PhysicalDamageStats { get; } = new(); + public Dictionary MagicDamageStats { get; } = new(); + public Dictionary RealDamageStats { get; } = new(); public Dictionary AvgDamageStats { get @@ -84,12 +84,12 @@ namespace Milimoe.FunGame.Core.Entity return avgdamage; } } - public Dictionary Kills { get; set; } = new(); - public Dictionary Deaths { get; set; } = new(); - public Dictionary Assists { get; set; } = new(); - public Dictionary Plays { get; set; } = new(); - public Dictionary Wins { get; set; } = new(); - public Dictionary Loses { get; set; } = new(); + public Dictionary Kills { get; } = new(); + public Dictionary Deaths { get; } = new(); + public Dictionary Assists { get; } = new(); + public Dictionary Plays { get; } = new(); + public Dictionary Wins { get; } = new(); + public Dictionary Loses { get; } = new(); public Dictionary Winrates { get @@ -108,9 +108,9 @@ namespace Milimoe.FunGame.Core.Entity return winrates; } } - public Dictionary RatingStats { get; set; } = new(); - public Dictionary EloStats { get; set; } = new(); - public Dictionary RankStats { get; set; } = new(); + public Dictionary RatingStats { get; } = new(); + public Dictionary EloStats { get; } = new(); + public Dictionary RankStats { get; } = new(); public string GetWinrate(long season) {