From 8f13505e15b24d70cad7ab0efc29a7eaddb56ddb Mon Sep 17 00:00:00 2001 From: yeziuku <53083103+yeziuku@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:02:32 +0800 Subject: [PATCH] Update User.cs --- Entity/User/User.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Entity/User/User.cs b/Entity/User/User.cs index 1912131..b232e19 100644 --- a/Entity/User/User.cs +++ b/Entity/User/User.cs @@ -22,12 +22,12 @@ namespace Milimoe.FunGame.Core.Entity public decimal Materials { get; set; } = 0; public decimal GameTime { get; set; } = 0; public string AutoKey { get; set; } = ""; - public UserStatistics? Statistics { get; set; } = null; + public UserStatistics Statistics { get; } public Inventory? Inventory { get; set; } = null; internal User() { - + this.Statistics = new(this); } internal User(long Id = 0, string Username = "", DateTime? RegTime = null, DateTime? LastTime = null, string Email = "", string NickName = "", bool IsAdmin = false, bool IsOperator = false, bool IsEnable = true, decimal Credits = 0, decimal Materials = 0, decimal GameTime = 0, string AutoKey = "") @@ -45,6 +45,7 @@ namespace Milimoe.FunGame.Core.Entity this.Materials = Materials; this.GameTime = GameTime; this.AutoKey = AutoKey; + this.Statistics = new(this); } public override bool Equals(IBaseEntity? other)