forked from hajsdfgj/modular-overhaul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PostalService.cs
27 lines (22 loc) · 998 Bytes
/
PostalService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace DaLion.Overhaul.Modules.Taxes;
#region using directives
using DaLion.Shared.Extensions.SMAPI;
#endregion using directives
/// <summary>Responsible for collecting and delivering mail.</summary>
internal static class PostalService
{
/// <summary>Sends the post to the local player.</summary>
/// <param name="mail">The <see cref="Mail"/> to send.</param>
internal static void Send(Mail mail)
{
ModHelper.GameContent.InvalidateCacheAndLocalized("Data/mail");
Game1.player.mailForTomorrow.Add($"{Manifest.UniqueID}/{mail}");
}
/// <summary>Checks whether the local player has received this post.</summary>
/// <param name="mail">The <see cref="Mail"/> to be sent.</param>
/// <returns><see langword="true"/> if the player has or will receive the post, otherwise <see langword="false"/>.</returns>
internal static bool HasSent(Mail mail)
{
return Game1.player.hasOrWillReceiveMail($"{Manifest.UniqueID}/{mail}");
}
}