using System;
namespace StardewModdingAPI.Events
{
/// Event arguments for an event.
public class UnvalidatedUpdateTickingEventArgs : EventArgs
{
/*********
** Accessors
*********/
/// The number of ticks elapsed since the game started, including the current tick.
public uint Ticks { get; }
/// Whether is a multiple of 60, which happens approximately once per second.
public bool IsOneSecond { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The number of ticks elapsed since the game started, including the current tick.
internal UnvalidatedUpdateTickingEventArgs(uint ticks)
{
this.Ticks = ticks;
this.IsOneSecond = this.IsMultipleOf(60);
}
/// Get whether is a multiple of the given . This is mainly useful if you want to run logic intermittently (e.g. e.IsMultipleOf(30)
for every half-second).
/// The factor to check.
public bool IsMultipleOf(uint number)
{
return this.Ticks % number == 0;
}
}
}