Changes

Jump to navigation Jump to search
Line 16: Line 16:     
The build config NuGet package should detect most implicit conversions and show an appropriate build warning.
 
The build config NuGet package should detect most implicit conversions and show an appropriate build warning.
 +
 +
==Main classes==
 +
===Game1===
 +
<tt>Game1</tt> is the game's core logic. Most of the game state is tracked through this class. Here are some of the most useful fields:
 +
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! purpose
 +
|-
 +
| <tt>Game1.player</tt>
 +
| The current player.
 +
|-
 +
| <tt>Game1.currentLocation</tt>
 +
| The game location containing the current player. '''For a non-main player, may be <tt>null</tt> when transitioning between locations.'''
 +
|-
 +
| <tt>Game1.locations</tt>
 +
| All locations in the game. '''For a non-main player, use [[Modding:Modder Guide/APIs/Multiplayer#GetActiveLocations|SMAPI's <tt>GetActiveLocations</tt> method]] instead.'''
 +
|-
 +
| <tt>Game1.timeOfDay</tt><br /><tt>Game1.dayOfMonth</tt><br /><tt>Game1.currentSeason</tt><br /><tt>Game1.year</tt>
 +
| The current time, day, season, and year. See also [[Modding:Modder Guide/APIs/Utilities#Dates|SMAPI's date utility]].
 +
|-
 +
| <tt>Game1.itemsToShip</tt>
 +
| The items in the shipping bin.
 +
|-
 +
| <tt>Game1.activeClickableMenu</tt>
 +
| The modal menu being displayed. Creating an <tt>IClickableMenu</tt> subclass and assigning an instance to this field will display it.
 +
|}
    
[[Category:Modding]]
 
[[Category:Modding]]
translators
8,439

edits

Navigation menu