usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingSystem.Diagnostics;usingSystem.Diagnostics.CodeAnalysis;usingSystem.Linq;usingSystem.Threading.Tasks;usingMicrosoft.Xna.Framework;usingMicrosoft.Xna.Framework.Graphics;usingMicrosoft.Xna.Framework.Input;usingStardewModdingAPI.Events;usingStardewValley;usingStardewValley.BellsAndWhistles;usingStardewValley.Locations;usingStardewValley.Menus;usingStardewValley.Tools;usingxTile.Dimensions;usingxTile.Layers;usingSFarmer=StardewValley.Farmer;namespaceStardewModdingAPI.Framework{/// <summary>SMAPI's extension of the game's core <see cref="Game1"/>, used to inject events.</summary>internalclassSGame:Game1{/********* ** Properties *********//**** ** SMAPI state ****//// <summary>The maximum number of consecutive attempts SMAPI should make to recover from a draw error.</summary>privatereadonlyintMaxFailedDraws=60;// roughly one second/// <summary>The number of ticks until SMAPI should notify mods that the game has loaded.</summary>/// <remarks>Skipping a few frames ensures the game finishes initialising the world before mods try to change it.</remarks>privateintAfterLoadTimer=5;/// <summary>The number of consecutive failed draws.</summary>privateintFailedDraws;/// <summary>Whether the player has loaded a save and the world has finished initialising.</summary>privateboolIsWorldReady=>this.AfterLoadTimer<0;/// <summary>Whether the game is returning to the menu.</summary>privateboolIsExiting;/// <summary>Whether the game's zoom level is at 100% (i.e. nothing should be scaled).</summary>publicboolZoomLevelIsOne=>Game1.options.zoomLevel.Equals(1.0f);/// <summary>Encapsulates monitoring and logging.</summary>privatereadonlyIMonitorMonitor;/**** ** Game state ****//// <summary>Arrays of pressed controller buttons indexed by <see cref="PlayerIndex"/>.</summary>