summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events/UpdateTickedEventArgs.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Events/UpdateTickedEventArgs.cs')
-rw-r--r--src/SMAPI/Events/UpdateTickedEventArgs.cs13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/SMAPI/Events/UpdateTickedEventArgs.cs b/src/SMAPI/Events/UpdateTickedEventArgs.cs
index 3466b731..aa710b44 100644
--- a/src/SMAPI/Events/UpdateTickedEventArgs.cs
+++ b/src/SMAPI/Events/UpdateTickedEventArgs.cs
@@ -1,4 +1,5 @@
using System;
+using StardewValley;
namespace StardewModdingAPI.Events
{
@@ -9,23 +10,15 @@ namespace StardewModdingAPI.Events
** Accessors
*********/
/// <summary>The number of ticks elapsed since the game started, including the current tick.</summary>
- public uint Ticks { get; }
+ public uint Ticks => (uint)Game1.ticks;
/// <summary>Whether <see cref="Ticks"/> is a multiple of 60, which happens approximately once per second.</summary>
- public bool IsOneSecond { get; }
+ public bool IsOneSecond => Game1.ticks % 60 == 0;
/*********
** Public methods
*********/
- /// <summary>Construct an instance.</summary>
- /// <param name="ticks">The number of ticks elapsed since the game started, including the current tick.</param>
- internal UpdateTickedEventArgs(uint ticks)
- {
- this.Ticks = ticks;
- this.IsOneSecond = this.IsMultipleOf(60);
- }
-
/// <summary>Get whether <see cref="Ticks"/> is a multiple of the given <paramref name="number"/>. This is mainly useful if you want to run logic intermittently (e.g. <code>e.IsMultipleOf(30)</code> for every half-second).</summary>
/// <param name="number">The factor to check.</param>
public bool IsMultipleOf(uint number)