Implement send mail and mail list

Optimize duplicate code
This commit is contained in:
2022-10-28 00:22:15 +08:00
parent 5c7c64ea6c
commit fd515b18cf
8 changed files with 859 additions and 642 deletions

View File

@@ -69,5 +69,7 @@ namespace GrasscutterTools.Game
public string[] Names { get; }
public string[] Lines { get; }
public static int ToId(string line) => int.Parse(line.Substring(0, line.IndexOf(':')).Trim());
}
}

View File

@@ -45,5 +45,13 @@ namespace GrasscutterTools.Game.Mail
/// 发送时间
/// </summary>
public DateTime SendTime { get; set; }
public override string ToString()
{
if (SendToAll)
return $"ToAll: [{Title}] {Content} | {SendTime}";
else
return $"To[{Recipient}]: [{Title}] {Content} | {SendTime}";
}
}
}

View File

@@ -22,7 +22,12 @@
public override string ToString()
{
return $"{ItemId}:{GameData.Items[ItemId]} x{ItemCount} lv{ItemLevel}";
if (ItemLevel > 1)
return $"{ItemId}:{GameData.Items[ItemId]} x{ItemCount} lv{ItemLevel}";
else if (ItemCount > 1)
return $"{ItemId}:{GameData.Items[ItemId]} x{ItemCount}";
else
return $"{ItemId}:{GameData.Items[ItemId]}";
}
}
}