summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Events')
-rw-r--r--src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs10
-rw-r--r--src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs10
-rw-r--r--src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.cs13
-rw-r--r--src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.cs13
-rw-r--r--src/SMAPI/Events/UpdateTickedEventArgs.cs13
-rw-r--r--src/SMAPI/Events/UpdateTickingEventArgs.cs13
6 files changed, 16 insertions, 56 deletions
diff --git a/src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs b/src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs
index d330502a..dadbb71a 100644
--- a/src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs
+++ b/src/SMAPI/Events/OneSecondUpdateTickedEventArgs.cs
@@ -1,4 +1,5 @@
using System;
+using StardewValley;
namespace StardewModdingAPI.Events
{
@@ -9,19 +10,12 @@ 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;
/*********
** 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 OneSecondUpdateTickedEventArgs(uint ticks)
- {
- this.Ticks = ticks;
- }
-
/// <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)
diff --git a/src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs b/src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs
index cdd9f4cc..e9bb46c6 100644
--- a/src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs
+++ b/src/SMAPI/Events/OneSecondUpdateTickingEventArgs.cs
@@ -1,4 +1,5 @@
using System;
+using StardewValley;
namespace StardewModdingAPI.Events
{
@@ -9,19 +10,12 @@ 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;
/*********
** 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 OneSecondUpdateTickingEventArgs(uint ticks)
- {
- this.Ticks = ticks;
- }
-
/// <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)
diff --git a/src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.cs b/src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.cs
index 95ae59d8..d15e9531 100644
--- a/src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.cs
+++ b/src/SMAPI/Events/UnvalidatedUpdateTickedEventArgs.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 UnvalidatedUpdateTickedEventArgs(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)
diff --git a/src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.cs b/src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.cs
index 4ed781e0..577f0776 100644
--- a/src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.cs
+++ b/src/SMAPI/Events/UnvalidatedUpdateTickingEventArgs.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 UnvalidatedUpdateTickingEventArgs(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)
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)
diff --git a/src/SMAPI/Events/UpdateTickingEventArgs.cs b/src/SMAPI/Events/UpdateTickingEventArgs.cs
index d4913268..cacf5a54 100644
--- a/src/SMAPI/Events/UpdateTickingEventArgs.cs
+++ b/src/SMAPI/Events/UpdateTickingEventArgs.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 UpdateTickingEventArgs(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)