usingSystem;usingSystem.Collections.Generic;usingSystem.Collections.ObjectModel;usingSystem.Diagnostics.CodeAnalysis;usingSystem.Linq;usingSystem.Text;usingSystem.Threading;usingMicrosoft.Xna.Framework;usingMicrosoft.Xna.Framework.Graphics;usingMicrosoft.Xna.Framework.Input;usingNetcode;usingStardewModdingAPI.Events;usingStardewModdingAPI.Framework.Events;usingStardewModdingAPI.Framework.Input;usingStardewModdingAPI.Framework.Reflection;usingStardewModdingAPI.Framework.StateTracking;usingStardewModdingAPI.Framework.StateTracking.FieldWatchers;usingStardewModdingAPI.Framework.Utilities;usingStardewValley;usingStardewValley.BellsAndWhistles;usingStardewValley.Buildings;usingStardewValley.Locations;usingStardewValley.Menus;usingStardewValley.TerrainFeatures;usingStardewValley.Tools;usingxTile.Dimensions;usingxTile.Layers;usingObject=StardewValley.Object;namespaceStardewModdingAPI.Framework{/// <summary>SMAPI's extension of the game's core <see cref="Game1"/>, used to inject events.</summary>internalclassSGame:Game1{/********* ** Properties *********//**** ** Constructor hack ****//// <summary>A static instance of <see cref="Monitor"/> to use while <see cref="Game1"/> is initialising, which happens before the <see cref="SGame"/> constructor runs.</summary>internalstaticIMonitorMonitorDuringInitialisation;/// <summary>A static instance of <see cref="Reflection"/> to use while <see cref="Game1"/> is initialising, which happens before the <see cref="SGame"/> constructor runs.</summary>internalstaticReflectorReflectorDuringInitialisation;/**** ** SMAPI state ****//// <summary>Encapsulates monitoring and logging.</summary>privatereadonlyIMonitorMonitor;/// <summary>Manages SMAPI events for mods.</summary>privatereadonlyEventManagerEvents;/// <summary>The maximum number of consecutive attempts SMAPI should make to recover from a draw error.</summary>privatereadonlyCountdownDrawCrashTimer=newCountdown(60);// 60 ticks = roughly one second/// <summary>The maximum number of consecutive attempts SMAPI should make to recover from an update error.</summary>privatereadonlyCountdownUpdateCrashTimer=newCountdown(60