diff --git a/Entity/Statistics/UserStatistics.cs b/Entity/Statistics/UserStatistics.cs index 5933572..3572133 100644 --- a/Entity/Statistics/UserStatistics.cs +++ b/Entity/Statistics/UserStatistics.cs @@ -9,8 +9,8 @@ namespace Milimoe.FunGame.Core.Entity * Key为赛季(long),每个key代表第key赛季,key = 0时为生涯数据。 */ - public int Id { get; set; } - public User User { get; set; } = new User(); + public long Id => User?.Id ?? 0L; + public User? User { get; } public Dictionary DamageStats { get; set; } = new Dictionary(); public Dictionary PhysicalDamageStats { get; set; } = new Dictionary(); public Dictionary MagicDamageStats { get; set; } = new Dictionary(); @@ -114,5 +114,10 @@ namespace Milimoe.FunGame.Core.Entity public Dictionary RatingStats { get; set; } = new Dictionary(); public Dictionary EloStats { get; set; } = new Dictionary(); public Dictionary RankStats { get; set; } = new Dictionary(); + + internal UserStatistics(User user) + { + User = user; + } } }