From 52e9695b930e7b5a13fdfd92a9dd88a66c89a42e Mon Sep 17 00:00:00 2001 From: ZouJin Date: Sat, 11 May 2024 12:57:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=81=9C=E6=AD=A2=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=B7=A5=E4=BD=9C=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/WorkTimer.xaml.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/VPet-Simulator.Core/Display/WorkTimer.xaml.cs b/VPet-Simulator.Core/Display/WorkTimer.xaml.cs index c3b7219..6261d03 100644 --- a/VPet-Simulator.Core/Display/WorkTimer.xaml.cs +++ b/VPet-Simulator.Core/Display/WorkTimer.xaml.cs @@ -68,6 +68,17 @@ namespace VPet_Simulator.Core this.count = count * (1 + work.FinishBonus); this.spendtime = work.Time; } + /// + /// 完成工作信息 + /// + /// 当前工作 + /// 当前盈利(自动计算附加) + public FinishWorkInfo(Work work, double count, DateTime starttime) + { + this.work = work; + this.count = count * (1 + work.FinishBonus); + this.spendtime = DateTime.Now.Subtract(starttime).TotalMinutes; + } } /// /// UI相关显示 @@ -202,7 +213,7 @@ namespace VPet_Simulator.Core { if (m.State == Main.WorkingState.Work && m.NowWork != null) { - FinishWorkInfo fwi = new FinishWorkInfo(m.NowWork, GetCount); + FinishWorkInfo fwi = new FinishWorkInfo(m.NowWork, GetCount, StartTime); E_FinishWork?.Invoke(fwi); } Visibility = Visibility.Collapsed;