From 0416f4de9efe9338faf9405f9b3a81503d3fe50f Mon Sep 17 00:00:00 2001 From: milimoe Date: Tue, 31 Dec 2024 02:25:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/System/Quest.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Entity/System/Quest.cs diff --git a/Entity/System/Quest.cs b/Entity/System/Quest.cs new file mode 100644 index 0000000..fa6a174 --- /dev/null +++ b/Entity/System/Quest.cs @@ -0,0 +1,33 @@ +namespace Milimoe.FunGame.Core.Entity +{ + public class Quest() + { + public int Id { get; set; } = 0; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + public int EstimatedMinutes { get; set; } = 0; + public int Status { get; set; } = 0; + public int CharacterIndex { get; set; } = 0; + public Dictionary Awards { get; set; } = []; + + public override string ToString() + { + return $"{Id}. {Name}\r\n" + + $"{Description}\r\n" + + $"需要时间:{EstimatedMinutes} 分钟\r\n" + + $"奖励:{string.Join(",", Awards.Select(kv=> kv.Key + " * " + kv.Value))}\r\n" + + $"是否完成:{GetStatus()}"; + } + + private string GetStatus() + { + return Status switch + { + 1 => "进行中", + 2 => "已完成", + 3 => "已结算", + _ => "未开始" + }; + } + } +}