From bc64b3e8975c32d28b1309368c01a5014adcd8c6 Mon Sep 17 00:00:00 2001 From: yeziuku <53083103+yeziuku@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:00:54 +0800 Subject: [PATCH] Update UserStatistics.cs --- Entity/Statistics/UserStatistics.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; + } } }