summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-22 20:46:21 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-03-22 20:46:21 -0400
commitd3fbdf484a4d90365a55fb5058d75a8623f17d0f (patch)
treec4ada80c72916195398b315457c7310f0ed6dc8f /src
parenta42926868ae5878ed59d6406ca085b587299ba07 (diff)
downloadSMAPI-d3fbdf484a4d90365a55fb5058d75a8623f17d0f.tar.gz
SMAPI-d3fbdf484a4d90365a55fb5058d75a8623f17d0f.tar.bz2
SMAPI-d3fbdf484a4d90365a55fb5058d75a8623f17d0f.zip
reduce duplicated doc blocks
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Framework/Events/EventManager.cs105
-rw-r--r--src/SMAPI/Framework/Events/ManagedEvent.cs4
-rw-r--r--src/SMAPI/Framework/Events/ManagedEventHandler.cs4
-rw-r--r--src/SMAPI/Framework/Events/ModDisplayEvents.cs23
-rw-r--r--src/SMAPI/Framework/Events/ModEvents.cs16
-rw-r--r--src/SMAPI/Framework/Events/ModGameLoopEvents.cs30
-rw-r--r--src/SMAPI/Framework/Events/ModInputEvents.cs12
-rw-r--r--src/SMAPI/Framework/Events/ModMultiplayerEvents.cs10
-rw-r--r--src/SMAPI/Framework/Events/ModPlayerEvents.cs8
-rw-r--r--src/SMAPI/Framework/Events/ModSpecialisedEvents.cs8
-rw-r--r--src/SMAPI/Framework/Events/ModWorldEvents.cs20
-rw-r--r--src/SMAPI/Framework/Input/GamePadStateBuilder.cs7
-rw-r--r--src/SMAPI/Framework/Input/KeyboardStateBuilder.cs7
-rw-r--r--src/SMAPI/Framework/Input/MouseStateBuilder.cs7
-rw-r--r--src/SMAPI/Mod.cs16
15 files changed, 132 insertions, 145 deletions
diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs
index dfc289ed..fa4d564d 100644
--- a/src/SMAPI/Framework/Events/EventManager.cs
+++ b/src/SMAPI/Framework/Events/EventManager.cs
@@ -1,6 +1,4 @@
-using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
-using System.Reflection;
using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
@@ -15,166 +13,166 @@ namespace StardewModdingAPI.Framework.Events
/****
** Display
****/
- /// <summary>Raised after a game menu is opened, closed, or replaced.</summary>
+ /// <inheritdoc cref="IDisplayEvents.MenuChanged" />
public readonly ManagedEvent<MenuChangedEventArgs> MenuChanged;
- /// <summary>Raised before the game draws anything to the screen in a draw tick, as soon as the sprite batch is opened. The sprite batch may be closed and reopened multiple times after this event is called, but it's only raised once per draw tick. This event isn't useful for drawing to the screen, since the game will draw over it.</summary>
+ /// <inheritdoc cref="IDisplayEvents.Rendering" />
public readonly ManagedEvent<RenderingEventArgs> Rendering;
- /// <summary>Raised after the game draws to the sprite patch in a draw tick, just before the final sprite batch is rendered to the screen. Since the game may open/close the sprite batch multiple times in a draw tick, the sprite batch may not contain everything being drawn and some things may already be rendered to the screen. Content drawn to the sprite batch at this point will be drawn over all vanilla content (including menus, HUD, and cursor).</summary>
+ /// <inheritdoc cref="IDisplayEvents.Rendered" />
public readonly ManagedEvent<RenderedEventArgs> Rendered;
- /// <summary>Raised before the game world is drawn to the screen.</summary>
+ /// <inheritdoc cref="IDisplayEvents.RenderingWorld" />
public readonly ManagedEvent<RenderingWorldEventArgs> RenderingWorld;
- /// <summary>Raised after the game world is drawn to the sprite patch, before it's rendered to the screen.</summary>
+ /// <inheritdoc cref="IDisplayEvents.RenderedWorld" />
public readonly ManagedEvent<RenderedWorldEventArgs> RenderedWorld;
- /// <summary>When a menu is open (<see cref="StardewValley.Game1.activeClickableMenu"/> isn't null), raised before that menu is drawn to the screen.</summary>
+ /// <inheritdoc cref="IDisplayEvents.RenderingActiveMenu" />
public readonly ManagedEvent<RenderingActiveMenuEventArgs> RenderingActiveMenu;
- /// <summary>When a menu is open (<see cref="StardewValley.Game1.activeClickableMenu"/> isn't null), raised after that menu is drawn to the sprite batch but before it's rendered to the screen.</summary>
+ /// <inheritdoc cref="IDisplayEvents.RenderedActiveMenu" />
public readonly ManagedEvent<RenderedActiveMenuEventArgs> RenderedActiveMenu;
- /// <summary>Raised before drawing the HUD (item toolbar, clock, etc) to the screen.</summary>
+ /// <inheritdoc cref="IDisplayEvents.RenderingHud" />
public readonly ManagedEvent<RenderingHudEventArgs> RenderingHud;
- /// <summary>Raised after drawing the HUD (item toolbar, clock, etc) to the sprite batch, but before it's rendered to the screen.</summary>
+ /// <inheritdoc cref="IDisplayEvents.RenderedHud" />
public readonly ManagedEvent<RenderedHudEventArgs> RenderedHud;
- /// <summary>Raised after the game window is resized.</summary>
+ /// <inheritdoc cref="IDisplayEvents.WindowResized" />
public readonly ManagedEvent<WindowResizedEventArgs> WindowResized;
/****
** Game loop
****/
- /// <summary>Raised after the game is launched, right before the first update tick.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.GameLaunched" />
public readonly ManagedEvent<GameLaunchedEventArgs> GameLaunched;
- /// <summary>Raised before the game performs its overall update tick (≈60 times per second).</summary>
+ /// <inheritdoc cref="IGameLoopEvents.UpdateTicking" />
public readonly ManagedEvent<UpdateTickingEventArgs> UpdateTicking;
- /// <summary>Raised after the game performs its overall update tick (≈60 times per second).</summary>
+ /// <inheritdoc cref="IGameLoopEvents.UpdateTicked" />
public readonly ManagedEvent<UpdateTickedEventArgs> UpdateTicked;
- /// <summary>Raised once per second before the game performs its overall update tick.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.OneSecondUpdateTicking" />
public readonly ManagedEvent<OneSecondUpdateTickingEventArgs> OneSecondUpdateTicking;
- /// <summary>Raised once per second after the game performs its overall update tick.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.OneSecondUpdateTicked" />
public readonly ManagedEvent<OneSecondUpdateTickedEventArgs> OneSecondUpdateTicked;
- /// <summary>Raised before the game creates the save file.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.SaveCreating" />
public readonly ManagedEvent<SaveCreatingEventArgs> SaveCreating;
- /// <summary>Raised after the game finishes creating the save file.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.SaveCreated" />
public readonly ManagedEvent<SaveCreatedEventArgs> SaveCreated;
- /// <summary>Raised before the game begins writes data to the save file (except the initial save creation).</summary>
+ /// <inheritdoc cref="IGameLoopEvents.Saving" />
public readonly ManagedEvent<SavingEventArgs> Saving;
- /// <summary>Raised after the game finishes writing data to the save file (except the initial save creation).</summary>
+ /// <inheritdoc cref="IGameLoopEvents.Saved" />
public readonly ManagedEvent<SavedEventArgs> Saved;
- /// <summary>Raised after the player loads a save slot and the world is initialized.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.SaveLoaded" />
public readonly ManagedEvent<SaveLoadedEventArgs> SaveLoaded;
- /// <summary>Raised after the game begins a new day, including when loading a save.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.DayStarted" />
public readonly ManagedEvent<DayStartedEventArgs> DayStarted;
- /// <summary>Raised before the game ends the current day. This happens before it starts setting up the next day and before <see cref="Saving"/>.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.DayEnding" />
public readonly ManagedEvent<DayEndingEventArgs> DayEnding;
- /// <summary>Raised after the in-game clock time changes.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.TimeChanged" />
public readonly ManagedEvent<TimeChangedEventArgs> TimeChanged;
- /// <summary>Raised after the game returns to the title screen.</summary>
+ /// <inheritdoc cref="IGameLoopEvents.ReturnedToTitle" />
public readonly ManagedEvent<ReturnedToTitleEventArgs> ReturnedToTitle;
/****
** Input
****/
- /// <summary>Raised after the player presses or releases any buttons on the keyboard, controller, or mouse.</summary>
+ /// <inheritdoc cref="IInputEvents.ButtonsChanged" />
public readonly ManagedEvent<ButtonsChangedEventArgs> ButtonsChanged;
- /// <summary>Raised after the player presses a button on the keyboard, controller, or mouse.</summary>
+ /// <inheritdoc cref="IInputEvents.ButtonPressed" />
public readonly ManagedEvent<ButtonPressedEventArgs> ButtonPressed;
- /// <summary>Raised after the player released a button on the keyboard, controller, or mouse.</summary>
+ /// <inheritdoc cref="IInputEvents.ButtonReleased" />
public readonly ManagedEvent<ButtonReleasedEventArgs> ButtonReleased;
- /// <summary>Raised after the player moves the in-game cursor.</summary>
+ /// <inheritdoc cref="IInputEvents.CursorMoved" />
public readonly ManagedEvent<CursorMovedEventArgs> CursorMoved;
- /// <summary>Raised after the player scrolls the mouse wheel.</summary>
+ /// <inheritdoc cref="IInputEvents.MouseWheelScrolled" />
public readonly ManagedEvent<MouseWheelScrolledEventArgs> MouseWheelScrolled;
/****
** Multiplayer
****/
- /// <summary>Raised after the mod context for a peer is received. This happens before the game approves the connection (<see cref="IMultiplayerEvents.PeerConnected"/>), so the player doesn't yet exist in the game. This is the earliest point where messages can be sent to the peer via SMAPI.</summary>
+ /// <inheritdoc cref="IMultiplayerEvents.PeerContextReceived" />
public readonly ManagedEvent<PeerContextReceivedEventArgs> PeerContextReceived;
- /// <summary>Raised after a peer connection is approved by the game.</summary>
+ /// <inheritdoc cref="IMultiplayerEvents.PeerConnected" />
public readonly ManagedEvent<PeerConnectedEventArgs> PeerConnected;
- /// <summary>Raised after a mod message is received over the network.</summary>
+ /// <inheritdoc cref="IMultiplayerEvents.ModMessageReceived" />
public readonly ManagedEvent<ModMessageReceivedEventArgs> ModMessageReceived;
- /// <summary>Raised after the connection with a peer is severed.</summary>
+ /// <inheritdoc cref="IMultiplayerEvents.PeerDisconnected" />
public readonly ManagedEvent<PeerDisconnectedEventArgs> PeerDisconnected;
/****
** Player
****/
- /// <summary>Raised after items are added or removed to a player's inventory.</summary>
+ /// <inheritdoc cref="IPlayerEvents.InventoryChanged" />
public readonly ManagedEvent<InventoryChangedEventArgs> InventoryChanged;
- /// <summary>Raised after a player skill level changes. This happens as soon as they level up, not when the game notifies the player after their character goes to bed.</summary>
+ /// <inheritdoc cref="IPlayerEvents.LevelChanged" />
public readonly ManagedEvent<LevelChangedEventArgs> LevelChanged;
- /// <summary>Raised after a player warps to a new location.</summary>
+ /// <inheritdoc cref="IPlayerEvents.Warped" />
public readonly ManagedEvent<WarpedEventArgs> Warped;
/****
** World
****/
- /// <summary>Raised after a game location is added or removed.</summary>
+ /// <inheritdoc cref="IWorldEvents.LocationListChanged" />
public readonly ManagedEvent<LocationListChangedEventArgs> LocationListChanged;
- /// <summary>Raised after buildings are added or removed in a location.</summary>
+ /// <inheritdoc cref="IWorldEvents.BuildingListChanged" />
public readonly ManagedEvent<BuildingListChangedEventArgs> BuildingListChanged;
- /// <summary>Raised after debris are added or removed in a location.</summary>
+ /// <inheritdoc cref="IWorldEvents.DebrisListChanged" />
public readonly ManagedEvent<DebrisListChangedEventArgs> DebrisListChanged;
- /// <summary>Raised after large terrain features (like bushes) are added or removed in a location.</summary>
+ /// <inheritdoc cref="IWorldEvents.LargeTerrainFeatureListChanged" />
public readonly ManagedEvent<LargeTerrainFeatureListChangedEventArgs> LargeTerrainFeatureListChanged;
- /// <summary>Raised after NPCs are added or removed in a location.</summary>
+ /// <inheritdoc cref="IWorldEvents.NpcListChanged" />
public readonly ManagedEvent<NpcListChangedEventArgs> NpcListChanged;
- /// <summary>Raised after objects are added or removed in a location.</summary>
+ /// <inheritdoc cref="IWorldEvents.ObjectListChanged" />
public readonly ManagedEvent<ObjectListChangedEventArgs> ObjectListChanged;
- /// <summary>Raised after items are added or removed from a chest.</summary>
+ /// <inheritdoc cref="IWorldEvents.ChestInventoryChanged" />
public readonly ManagedEvent<ChestInventoryChangedEventArgs> ChestInventoryChanged;
- /// <summary>Raised after terrain features (like floors and trees) are added or removed in a location.</summary>
+ /// <inheritdoc cref="IWorldEvents.TerrainFeatureListChanged" />
public readonly ManagedEvent<TerrainFeatureListChangedEventArgs> TerrainFeatureListChanged;
- /// <summary>Raised after furniture are added or removed in a location.</summary>
+ /// <inheritdoc cref="IWorldEvents.FurnitureListChanged" />
public readonly ManagedEvent<FurnitureListChangedEventArgs> FurnitureListChanged;
/****
** Specialized
****/
- /// <summary>Raised when the low-level stage in the game's loading process has changed. See notes on <see cref="ISpecializedEvents.LoadStageChanged"/>.</summary>
+ /// <inheritdoc cref="ISpecializedEvents.LoadStageChanged" />
public readonly ManagedEvent<LoadStageChangedEventArgs> LoadStageChanged;
- /// <summary>Raised before the game performs its overall update tick (≈60 times per second). See notes on <see cref="ISpecializedEvents.UnvalidatedUpdateTicking"/>.</summary>
+ /// <inheritdoc cref="ISpecializedEvents.UnvalidatedUpdateTicking" />
public readonly ManagedEvent<UnvalidatedUpdateTickingEventArgs> UnvalidatedUpdateTicking;
- /// <summary>Raised after the game performs its overall update tick (≈60 times per second). See notes on <see cref="ISpecializedEvents.UnvalidatedUpdateTicked"/>.</summary>
+ /// <inheritdoc cref="ISpecializedEvents.UnvalidatedUpdateTicked" />
public readonly ManagedEvent<UnvalidatedUpdateTickedEventArgs> UnvalidatedUpdateTicked;
@@ -247,12 +245,5 @@ namespace StardewModdingAPI.Framework.Events
this.UnvalidatedUpdateTicking = ManageEventOf<UnvalidatedUpdateTickingEventArgs>(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.UnvalidatedUpdateTicking), isPerformanceCritical: true);
this.UnvalidatedUpdateTicked = ManageEventOf<UnvalidatedUpdateTickedEventArgs>(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.UnvalidatedUpdateTicked), isPerformanceCritical: true);
}
-
- /// <summary>Get all managed events.</summary>
- public IEnumerable<IManagedEvent> GetAllEvents()
- {
- foreach (FieldInfo field in this.GetType().GetFields())
- yield return (IManagedEvent)field.GetValue(this);
- }
}
}
diff --git a/src/SMAPI/Framework/Events/ManagedEvent.cs b/src/SMAPI/Framework/Events/ManagedEvent.cs
index f48c3aeb..a200393d 100644
--- a/src/SMAPI/Framework/Events/ManagedEvent.cs
+++ b/src/SMAPI/Framework/Events/ManagedEvent.cs
@@ -33,10 +33,10 @@ namespace StardewModdingAPI.Framework.Events
/*********
** Accessors
*********/
- /// <summary>A human-readable name for the event.</summary>
+ /// <inheritdoc />
public string EventName { get; }
- /// <summary>Whether the event is typically called at least once per second.</summary>
+ /// <inheritdoc />
public bool IsPerformanceCritical { get; }
diff --git a/src/SMAPI/Framework/Events/ManagedEventHandler.cs b/src/SMAPI/Framework/Events/ManagedEventHandler.cs
index b32a2a22..28e88be0 100644
--- a/src/SMAPI/Framework/Events/ManagedEventHandler.cs
+++ b/src/SMAPI/Framework/Events/ManagedEventHandler.cs
@@ -39,9 +39,7 @@ namespace StardewModdingAPI.Framework.Events
this.SourceMod = sourceMod;
}
- /// <summary>Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.</summary>
- /// <param name="obj">An object to compare with this instance.</param>
- /// <exception cref="T:System.ArgumentException"><paramref name="obj" /> is not the same type as this instance.</exception>
+ /// <inheritdoc />
public int CompareTo(object obj)
{
if (!(obj is ManagedEventHandler<TEventArgs> other))
diff --git a/src/SMAPI/Framework/Events/ModDisplayEvents.cs b/src/SMAPI/Framework/Events/ModDisplayEvents.cs
index 54d40dee..48f55324 100644
--- a/src/SMAPI/Framework/Events/ModDisplayEvents.cs
+++ b/src/SMAPI/Framework/Events/ModDisplayEvents.cs
@@ -1,79 +1,78 @@
using System;
using StardewModdingAPI.Events;
-using StardewValley;
namespace StardewModdingAPI.Framework.Events
{
- /// <summary>Events related to UI and drawing to the screen.</summary>
+ /// <inheritdoc cref="IDisplayEvents" />
internal class ModDisplayEvents : ModEventsBase, IDisplayEvents
{
/*********
** Accessors
*********/
- /// <summary>Raised after a game menu is opened, closed, or replaced.</summary>
+ /// <inheritdoc />
public event EventHandler<MenuChangedEventArgs> MenuChanged
{
add => this.EventManager.MenuChanged.Add(value, this.Mod);
remove => this.EventManager.MenuChanged.Remove(value);
}
- /// <summary>Raised before the game draws anything to the screen in a draw tick, as soon as the sprite batch is opened. The sprite batch may be closed and reopened multiple times after this event is called, but it's only raised once per draw tick. This event isn't useful for drawing to the screen, since the game will draw over it.</summary>
+ /// <inheritdoc />
public event EventHandler<RenderingEventArgs> Rendering
{
add => this.EventManager.Rendering.Add(value, this.Mod);
remove => this.EventManager.Rendering.Remove(value);
}
- /// <summary>Raised after the game draws to the sprite patch in a draw tick, just before the final sprite batch is rendered to the screen. Since the game may open/close the sprite batch multiple times in a draw tick, the sprite batch may not contain everything being drawn and some things may already be rendered to the screen. Content drawn to the sprite batch at this point will be drawn over all vanilla content (including menus, HUD, and cursor).</summary>
+ /// <inheritdoc />
public event EventHandler<RenderedEventArgs> Rendered
{
add => this.EventManager.Rendered.Add(value, this.Mod);
remove => this.EventManager.Rendered.Remove(value);
}
- /// <summary>Raised before the game world is drawn to the screen. This event isn't useful for drawing to the screen, since the game will draw over it.</summary>
+ /// <inheritdoc />
public event EventHandler<RenderingWorldEventArgs> RenderingWorld
{
add => this.EventManager.RenderingWorld.Add(value, this.Mod);
remove => this.EventManager.RenderingWorld.Remove(value);
}
- /// <summary>Raised after the game world is drawn to the sprite patch, before it's rendered to the screen. Content drawn to the sprite batch at this point will be drawn over the world, but under any active menu, HUD elements, or cursor.</summary>
+ /// <inheritdoc />
public event EventHandler<RenderedWorldEventArgs> RenderedWorld
{
add => this.EventManager.RenderedWorld.Add(value, this.Mod);
remove => this.EventManager.RenderedWorld.Remove(value);
}
- /// <summary>When a menu is open (<see cref="Game1.activeClickableMenu"/> isn't null), raised before that menu is drawn to the screen. This includes the game's internal menus like the title screen. Content drawn to the sprite batch at this point will appear under the menu.</summary>
+ /// <inheritdoc />
public event EventHandler<RenderingActiveMenuEventArgs> RenderingActiveMenu
{
add => this.EventManager.RenderingActiveMenu.Add(value, this.Mod);
remove => this.EventManager.RenderingActiveMenu.Remove(value);
}
- /// <summary>When a menu is open (<see cref="Game1.activeClickableMenu"/> isn't null), raised after that menu is drawn to the sprite batch but before it's rendered to the screen. Content drawn to the sprite batch at this point will appear over the menu and menu cursor.</summary>
+ /// <inheritdoc />
public event EventHandler<RenderedActiveMenuEventArgs> RenderedActiveMenu
{
add => this.EventManager.RenderedActiveMenu.Add(value, this.Mod);
remove => this.EventManager.RenderedActiveMenu.Remove(value);
}
- /// <summary>Raised before drawing the HUD (item toolbar, clock, etc) to the screen. The vanilla HUD may be hidden at this point (e.g. because a menu is open). Content drawn to the sprite batch at this point will appear under the HUD.</summary>
+ /// <inheritdoc />
public event EventHandler<RenderingHudEventArgs> RenderingHud
{
add => this.EventManager.RenderingHud.Add(value, this.Mod);
remove => this.EventManager.RenderingHud.Remove(value);
}
- /// <summary>Raised after drawing the HUD (item toolbar, clock, etc) to the sprite batch, but before it's rendered to the screen. The vanilla HUD may be hidden at this point (e.g. because a menu is open). Content drawn to the sprite batch at this point will appear over the HUD.</summary>
+ /// <inheritdoc />
public event EventHandler<RenderedHudEventArgs> RenderedHud
{
add => this.EventManager.RenderedHud.Add(value, this.Mod);
remove => this.EventManager.RenderedHud.Remove(value);
}
- /// <summary>Raised after the game window is resized.</summary>
+ /// <inheritdoc />
public event EventHandler<WindowResizedEventArgs> WindowResized
{
add => this.EventManager.WindowResized.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModEvents.cs b/src/SMAPI/Framework/Events/ModEvents.cs
index 1d1c92c6..0c365d42 100644
--- a/src/SMAPI/Framework/Events/ModEvents.cs
+++ b/src/SMAPI/Framework/Events/ModEvents.cs
@@ -2,31 +2,31 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// <summary>Manages access to events raised by SMAPI.</summary>
+ /// <inheritdoc />
internal class ModEvents : IModEvents
{
/*********
** Accessors
*********/
- /// <summary>Events related to UI and drawing to the screen.</summary>
+ /// <inheritdoc />
public IDisplayEvents Display { get; }
- /// <summary>Events linked to the game's update loop. The update loop runs roughly ≈60 times/second to run game logic like state changes, action handling, etc. These can be useful, but you should consider more semantic events like <see cref="IModEvents.Input"/> if possible.</summary>
+ /// <inheritdoc />
public IGameLoopEvents GameLoop { get; }
- /// <summary>Events raised when the player provides input using a controller, keyboard, or mouse.</summary>
+ /// <inheritdoc />
public IInputEvents Input { get; }
- /// <summary>Events raised for multiplayer messages and connections.</summary>
+ /// <inheritdoc />
public IMultiplayerEvents Multiplayer { get; }
- /// <summary>Events raised when the player data changes.</summary>
+ /// <inheritdoc />
public IPlayerEvents Player { get; }
- /// <summary>Events raised when something changes in the world.</summary>
+ /// <inheritdoc />
public IWorldEvents World { get; }
- /// <summary>Events serving specialized edge cases that shouldn't be used by most mods.</summary>
+ /// <inheritdoc />
public ISpecializedEvents Specialized { get; }
diff --git a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
index 1150d641..5f0db369 100644
--- a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
+++ b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
@@ -3,104 +3,104 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// <summary>Events linked to the game's update loop. The update loop runs roughly ≈60 times/second to run game logic like state changes, action handling, etc. These can be useful, but you should consider more semantic events like <see cref="IInputEvents"/> if possible.</summary>
+ /// <inheritdoc cref="IGameLoopEvents" />
internal class ModGameLoopEvents : ModEventsBase, IGameLoopEvents
{
/*********
** Accessors
*********/
- /// <summary>Raised after the game is launched, right before the first update tick.</summary>
+ /// <inheritdoc />
public event EventHandler<GameLaunchedEventArgs> GameLaunched
{
add => this.EventManager.GameLaunched.Add(value, this.Mod);
remove => this.EventManager.GameLaunched.Remove(value);
}
- /// <summary>Raised before the game performs its overall update tick (≈60 times per second).</summary>
+ /// <inheritdoc />
public event EventHandler<UpdateTickingEventArgs> UpdateTicking
{
add => this.EventManager.UpdateTicking.Add(value, this.Mod);
remove => this.EventManager.UpdateTicking.Remove(value);
}
- /// <summary>Raised after the game performs its overall update tick (≈60 times per second).</summary>
+ /// <inheritdoc />
public event EventHandler<UpdateTickedEventArgs> UpdateTicked
{
add => this.EventManager.UpdateTicked.Add(value, this.Mod);
remove => this.EventManager.UpdateTicked.Remove(value);
}
- /// <summary>Raised once per second before the game state is updated.</summary>
+ /// <inheritdoc />
public event EventHandler<OneSecondUpdateTickingEventArgs> OneSecondUpdateTicking
{
add => this.EventManager.OneSecondUpdateTicking.Add(value, this.Mod);
remove => this.EventManager.OneSecondUpdateTicking.Remove(value);
}
- /// <summary>Raised once per second after the game state is updated.</summary>
+ /// <inheritdoc />
public event EventHandler<OneSecondUpdateTickedEventArgs> OneSecondUpdateTicked
{
add => this.EventManager.OneSecondUpdateTicked.Add(value, this.Mod);
remove => this.EventManager.OneSecondUpdateTicked.Remove(value);
}
- /// <summary>Raised before the game creates a new save file.</summary>
+ /// <inheritdoc />
public event EventHandler<SaveCreatingEventArgs> SaveCreating
{
add => this.EventManager.SaveCreating.Add(value, this.Mod);
remove => this.EventManager.SaveCreating.Remove(value);
}
- /// <summary>Raised after the game finishes creating the save file.</summary>
+ /// <inheritdoc />
public event EventHandler<SaveCreatedEventArgs> SaveCreated
{
add => this.EventManager.SaveCreated.Add(value, this.Mod);
remove => this.EventManager.SaveCreated.Remove(value);
}
- /// <summary>Raised before the game begins writes data to the save file.</summary>
+ /// <inheritdoc />
public event EventHandler<SavingEventArgs> Saving
{
add => this.EventManager.Saving.Add(value, this.Mod);
remove => this.EventManager.Saving.Remove(value);
}
- /// <summary>Raised after the game finishes writing data to the save file.</summary>
+ /// <inheritdoc />
public event EventHandler<SavedEventArgs> Saved
{
add => this.EventManager.Saved.Add(value, this.Mod);
remove => this.EventManager.Saved.Remove(value);
}
- /// <summary>Raised after the player loads a save slot and the world is initialized.</summary>
+ /// <inheritdoc />
public event EventHandler<SaveLoadedEventArgs> SaveLoaded
{
add => this.EventManager.SaveLoaded.Add(value, this.Mod);
remove => this.EventManager.SaveLoaded.Remove(value);
}
- /// <summary>Raised after the game begins a new day (including when the player loads a save).</summary>
+ /// <inheritdoc />
public event EventHandler<DayStartedEventArgs> DayStarted
{
add => this.EventManager.DayStarted.Add(value, this.Mod);
remove => this.EventManager.DayStarted.Remove(value);
}
- /// <summary>Raised before the game ends the current day. This happens before it starts setting up the next day and before <see cref="IGameLoopEvents.Saving"/>.</summary>
+ /// <inheritdoc />
public event EventHandler<DayEndingEventArgs> DayEnding
{
add => this.EventManager.DayEnding.Add(value, this.Mod);
remove => this.EventManager.DayEnding.Remove(value);
}
- /// <summary>Raised after the in-game clock time changes.</summary>
+ /// <inheritdoc />
public event EventHandler<TimeChangedEventArgs> TimeChanged
{
add => this.EventManager.TimeChanged.Add(value, this.Mod);
remove => this.EventManager.TimeChanged.Remove(value);
}
- /// <summary>Raised after the game returns to the title screen.</summary>
+ /// <inheritdoc />
public event EventHandler<ReturnedToTitleEventArgs> ReturnedToTitle
{
add => this.EventManager.ReturnedToTitle.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModInputEvents.cs b/src/SMAPI/Framework/Events/ModInputEvents.cs
index 6f423e5d..40edf806 100644
--- a/src/SMAPI/Framework/Events/ModInputEvents.cs
+++ b/src/SMAPI/Framework/Events/ModInputEvents.cs
@@ -3,41 +3,41 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// <summary>Events raised when the player provides input using a controller, keyboard, or mouse.</summary>
+ /// <inheritdoc cref="IInputEvents" />
internal class ModInputEvents : ModEventsBase, IInputEvents
{
/*********
** Accessors
*********/
- /// <summary>Raised after the player presses or releases any buttons on the keyboard, controller, or mouse.</summary>
+ /// <inheritdoc />
public event EventHandler<ButtonsChangedEventArgs> ButtonsChanged
{
add => this.EventManager.ButtonsChanged.Add(value, this.Mod);
remove => this.EventManager.ButtonsChanged.Remove(value);
}
- /// <summary>Raised after the player presses a button on the keyboard, controller, or mouse.</summary>
+ /// <inheritdoc />
public event EventHandler<ButtonPressedEventArgs> ButtonPressed
{
add => this.EventManager.ButtonPressed.Add(value, this.Mod);
remove => this.EventManager.ButtonPressed.Remove(value);
}
- /// <summary>Raised after the player releases a button on the keyboard, controller, or mouse.</summary>
+ /// <inheritdoc />
public event EventHandler<ButtonReleasedEventArgs> ButtonReleased
{
add => this.EventManager.ButtonReleased.Add(value, this.Mod);
remove => this.EventManager.ButtonReleased.Remove(value);
}
- /// <summary>Raised after the player moves the in-game cursor.</summary>
+ /// <inheritdoc />
public event EventHandler<CursorMovedEventArgs> CursorMoved
{
add => this.EventManager.CursorMoved.Add(value, this.Mod);
remove => this.EventManager.CursorMoved.Remove(value);
}
- /// <summary>Raised after the player scrolls the mouse wheel.</summary>
+ /// <inheritdoc />
public event EventHandler<MouseWheelScrolledEventArgs> MouseWheelScrolled
{
add => this.EventManager.MouseWheelScrolled.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModMultiplayerEvents.cs b/src/SMAPI/Framework/Events/ModMultiplayerEvents.cs
index 2f9b9482..b90f64fa 100644
--- a/src/SMAPI/Framework/Events/ModMultiplayerEvents.cs
+++ b/src/SMAPI/Framework/Events/ModMultiplayerEvents.cs
@@ -3,34 +3,34 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// <summary>Events raised for multiplayer messages and connections.</summary>
+ /// <inheritdoc cref="IMultiplayerEvents" />
internal class ModMultiplayerEvents : ModEventsBase, IMultiplayerEvents
{
/*********
** Accessors
*********/
- /// <summary>Raised after the mod context for a peer is received. This happens before the game approves the connection (<see cref="IMultiplayerEvents.PeerConnected"/>), so the player doesn't yet exist in the game. This is the earliest point where messages can be sent to the peer via SMAPI.</summary>
+ /// <inheritdoc />
public event EventHandler<PeerContextReceivedEventArgs> PeerContextReceived
{
add => this.EventManager.PeerContextReceived.Add(value, this.Mod);
remove => this.EventManager.PeerContextReceived.Remove(value);
}
- /// <summary>Raised after a peer connection is approved by the game.</summary>
+ /// <inheritdoc />
public event EventHandler<PeerConnectedEventArgs> PeerConnected
{
add => this.EventManager.PeerConnected.Add(value, this.Mod);
remove => this.EventManager.PeerConnected.Remove(value);
}
- /// <summary>Raised after a mod message is received over the network.</summary>
+ /// <inheritdoc />
public event EventHandler<ModMessageReceivedEventArgs> ModMessageReceived
{
add => this.EventManager.ModMessageReceived.Add(value, this.Mod);
remove => this.EventManager.ModMessageReceived.Remove(value);
}
- /// <summary>Raised after the connection with a peer is severed.</summary>
+ /// <inheritdoc />
public event EventHandler<PeerDisconnectedEventArgs> PeerDisconnected
{
add => this.EventManager.PeerDisconnected.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModPlayerEvents.cs b/src/SMAPI/Framework/Events/ModPlayerEvents.cs
index 240beb8d..b2d89e9a 100644
--- a/src/SMAPI/Framework/Events/ModPlayerEvents.cs
+++ b/src/SMAPI/Framework/Events/ModPlayerEvents.cs
@@ -3,27 +3,27 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// <summary>Events raised when the player data changes.</summary>
+ /// <inheritdoc cref="IPlayerEvents" />
internal class ModPlayerEvents : ModEventsBase, IPlayerEvents
{
/*********
** Accessors
*********/
- /// <summary>Raised after items are added or removed to a player's inventory. NOTE: this event is currently only raised for the local player.</summary>
+ /// <inheritdoc />
public event EventHandler<InventoryChangedEventArgs> InventoryChanged
{
add => this.EventManager.InventoryChanged.Add(value, this.Mod);
remove => this.EventManager.InventoryChanged.Remove(value);
}
- /// <summary>Raised after a player skill level changes. This happens as soon as they level up, not when the game notifies the player after their character goes to bed. NOTE: this event is currently only raised for the local player.</summary>
+ /// <inheritdoc />
public event EventHandler<LevelChangedEventArgs> LevelChanged
{
add => this.EventManager.LevelChanged.Add(value, this.Mod);
remove => this.EventManager.LevelChanged.Remove(value);
}
- /// <summary>Raised after a player warps to a new location. NOTE: this event is currently only raised for the local player.</summary>
+ /// <inheritdoc />
public event EventHandler<WarpedEventArgs> Warped
{
add => this.EventManager.Warped.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs b/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs
index 1d6788e1..7980208b 100644
--- a/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs
+++ b/src/SMAPI/Framework/Events/ModSpecialisedEvents.cs
@@ -3,27 +3,27 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// <summary>Events serving specialized edge cases that shouldn't be used by most mods.</summary>
+ /// <inheritdoc cref="ISpecializedEvents" />
internal class ModSpecializedEvents : ModEventsBase, ISpecializedEvents
{
/*********
** Accessors
*********/
- /// <summary>Raised when the low-level stage in the game's loading process has changed. This is an advanced event for mods which need to run code at specific points in the loading process. The available stages or when they happen might change without warning in future versions (e.g. due to changes in the game's load process), so mods using this event are more likely to break or have bugs. Most mods should use <see cref="IGameLoopEvents"/> instead.</summary>
+ /// <inheritdoc />
public event EventHandler<LoadStageChangedEventArgs> LoadStageChanged
{
add => this.EventManager.LoadStageChanged.Add(value, this.Mod);
remove => this.EventManager.LoadStageChanged.Remove(value);
}
- /// <summary>Raised before the game state is updated (≈60 times per second), regardless of normal SMAPI validation. This event is not thread-safe and may be invoked while game logic is running asynchronously. Changes to game state in this method may crash the game or corrupt an in-progress save. Do not use this event unless you're fully aware of the context in which your code will be run. Mods using this event will trigger a stability warning in the SMAPI console.</summary>
+ /// <inheritdoc />
public event EventHandler<UnvalidatedUpdateTickingEventArgs> UnvalidatedUpdateTicking
{
add => this.EventManager.UnvalidatedUpdateTicking.Add(value, this.Mod);
remove => this.EventManager.UnvalidatedUpdateTicking.Remove(value);
}
- /// <summary>Raised after the game state is updated (≈60 times per second), regardless of normal SMAPI validation. This event is not thread-safe and may be invoked while game logic is running asynchronously. Changes to game state in this method may crash the game or corrupt an in-progress save. Do not use this event unless you're fully aware of the context in which your code will be run. Mods using this event will trigger a stability warning in the SMAPI console.</summary>
+ /// <inheritdoc />
public event EventHandler<UnvalidatedUpdateTickedEventArgs> UnvalidatedUpdateTicked
{
add => this.EventManager.UnvalidatedUpdateTicked.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Events/ModWorldEvents.cs b/src/SMAPI/Framework/Events/ModWorldEvents.cs
index f4c40abc..a7b7d799 100644
--- a/src/SMAPI/Framework/Events/ModWorldEvents.cs
+++ b/src/SMAPI/Framework/Events/ModWorldEvents.cs
@@ -3,69 +3,69 @@ using StardewModdingAPI.Events;
namespace StardewModdingAPI.Framework.Events
{
- /// <summary>Events raised when something changes in the world.</summary>
+ /// <inheritdoc cref="IWorldEvents" />
internal class ModWorldEvents : ModEventsBase, IWorldEvents
{
/*********
** Accessors
*********/
- /// <summary>Raised after a game location is added or removed.</summary>
+ /// <inheritdoc />
public event EventHandler<LocationListChangedEventArgs> LocationListChanged
{
add => this.EventManager.LocationListChanged.Add(value, this.Mod);
remove => this.EventManager.LocationListChanged.Remove(value);
}
- /// <summary>Raised after buildings are added or removed in a location.</summary>
+ /// <inheritdoc />
public event EventHandler<BuildingListChangedEventArgs> BuildingListChanged
{
add => this.EventManager.BuildingListChanged.Add(value, this.Mod);
remove => this.EventManager.BuildingListChanged.Remove(value);
}
- /// <summary>Raised after debris are added or removed in a location.</summary>
+ /// <inheritdoc />
public event EventHandler<DebrisListChangedEventArgs> DebrisListChanged
{
add => this.EventManager.DebrisListChanged.Add(value, this.Mod);
remove => this.EventManager.DebrisListChanged.Remove(value);
}
- /// <summary>Raised after large terrain features (like bushes) are added or removed in a location.</summary>
+ /// <inheritdoc />
public event EventHandler<LargeTerrainFeatureListChangedEventArgs> LargeTerrainFeatureListChanged
{
add => this.EventManager.LargeTerrainFeatureListChanged.Add(value, this.Mod);
remove => this.EventManager.LargeTerrainFeatureListChanged.Remove(value);
}
- /// <summary>Raised after NPCs are added or removed in a location.</summary>
+ /// <inheritdoc />
public event EventHandler<NpcListChangedEventArgs> NpcListChanged
{
add => this.EventManager.NpcListChanged.Add(value, this.Mod);
remove => this.EventManager.NpcListChanged.Remove(value);
}
- /// <summary>Raised after objects are added or removed in a location.</summary>
+ /// <inheritdoc />
public event EventHandler<ObjectListChangedEventArgs> ObjectListChanged
{
add => this.EventManager.ObjectListChanged.Add(value, this.Mod);
remove => this.EventManager.ObjectListChanged.Remove(value);
}
- /// <summary>Raised after items are added or removed from a chest.</summary>
+ /// <inheritdoc />
public event EventHandler<ChestInventoryChangedEventArgs> ChestInventoryChanged
{
add => this.EventManager.ChestInventoryChanged.Add(value, this.Mod);
remove => this.EventManager.ChestInventoryChanged.Remove(value);
}
- /// <summary>Raised after terrain features (like floors and trees) are added or removed in a location.</summary>
+ /// <inheritdoc />
public event EventHandler<TerrainFeatureListChangedEventArgs> TerrainFeatureListChanged
{
add => this.EventManager.TerrainFeatureListChanged.Add(value, this.Mod);
remove => this.EventManager.TerrainFeatureListChanged.Remove(value);
}
- /// <summary>Raised after furniture are added or removed in a location.</summary>
+ /// <inheritdoc />
public event EventHandler<FurnitureListChangedEventArgs> FurnitureListChanged
{
add => this.EventManager.FurnitureListChanged.Add(value, this.Mod);
diff --git a/src/SMAPI/Framework/Input/GamePadStateBuilder.cs b/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
index 3a99214f..ad254828 100644
--- a/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
+++ b/src/SMAPI/Framework/Input/GamePadStateBuilder.cs
@@ -85,8 +85,7 @@ namespace StardewModdingAPI.Framework.Input
this.RightStickPos = sticks.Right;
}
- /// <summary>Override the states for a set of buttons.</summary>
- /// <param name="overrides">The button state overrides.</param>
+ /// <inheritdoc />
public GamePadStateBuilder OverrideButtons(IDictionary<SButton, SButtonState> overrides)
{
if (!this.IsConnected)
@@ -151,7 +150,7 @@ namespace StardewModdingAPI.Framework.Input
return this;
}
- /// <summary>Get the currently pressed buttons.</summary>
+ /// <inheritdoc />
public IEnumerable<SButton> GetPressedButtons()
{
if (!this.IsConnected)
@@ -191,7 +190,7 @@ namespace StardewModdingAPI.Framework.Input
}
}
- /// <summary>Get the equivalent state.</summary>
+ /// <inheritdoc />
public GamePadState GetState()
{
this.State ??= new GamePadState(
diff --git a/src/SMAPI/Framework/Input/KeyboardStateBuilder.cs b/src/SMAPI/Framework/Input/KeyboardStateBuilder.cs
index 620ad442..eadb7a8a 100644
--- a/src/SMAPI/Framework/Input/KeyboardStateBuilder.cs
+++ b/src/SMAPI/Framework/Input/KeyboardStateBuilder.cs
@@ -31,8 +31,7 @@ namespace StardewModdingAPI.Framework.Input
this.PressedButtons.Add(button);
}
- /// <summary>Override the states for a set of buttons.</summary>
- /// <param name="overrides">The button state overrides.</param>
+ /// <inheritdoc />
public KeyboardStateBuilder OverrideButtons(IDictionary<SButton, SButtonState> overrides)
{
foreach (var pair in overrides)
@@ -51,14 +50,14 @@ namespace StardewModdingAPI.Framework.Input
return this;
}
- /// <summary>Get the currently pressed buttons.</summary>
+ /// <inheritdoc />
public IEnumerable<SButton> GetPressedButtons()
{
foreach (Keys key in this.PressedButtons)
yield return key.ToSButton();
}
- /// <summary>Get the equivalent state.</summary>
+ /// <inheritdoc />
public KeyboardState GetState()
{
return
diff --git a/src/SMAPI/Framework/Input/MouseStateBuilder.cs b/src/SMAPI/Framework/Input/MouseStateBuilder.cs
index a1ac5492..c2a0891b 100644
--- a/src/SMAPI/Framework/Input/MouseStateBuilder.cs
+++ b/src/SMAPI/Framework/Input/MouseStateBuilder.cs
@@ -51,8 +51,7 @@ namespace StardewModdingAPI.Framework.Input
this.ScrollWheelValue = state.ScrollWheelValue;
}
- /// <summary>Override the states for a set of buttons.</summary>
- /// <param name="overrides">The button state overrides.</param>
+ /// <inheritdoc />
public MouseStateBuilder OverrideButtons(IDictionary<SButton, SButtonState> overrides)
{
foreach (var pair in overrides)
@@ -67,7 +66,7 @@ namespace StardewModdingAPI.Framework.Input
return this;
}
- /// <summary>Get the currently pressed buttons.</summary>
+ /// <inheritdoc />
public IEnumerable<SButton> GetPressedButtons()
{
foreach (var pair in this.ButtonStates)
@@ -77,7 +76,7 @@ namespace StardewModdingAPI.Framework.Input
}
}
- /// <summary>Get the equivalent state.</summary>
+ /// <inheritdoc />
public MouseState GetState()
{
this.State ??= new MouseState(
diff --git a/src/SMAPI/Mod.cs b/src/SMAPI/Mod.cs
index 0e5be1c1..9af55cd4 100644
--- a/src/SMAPI/Mod.cs
+++ b/src/SMAPI/Mod.cs
@@ -8,25 +8,27 @@ namespace StardewModdingAPI
/*********
** Accessors
*********/
- /// <summary>Provides simplified APIs for writing mods.</summary>
+ /// <inheritdoc />
public IModHelper Helper { get; internal set; }
- /// <summary>Writes messages to the console and log file.</summary>
+ /// <inheritdoc />
public IMonitor Monitor { get; internal set; }
- /// <summary>The mod's manifest.</summary>
+ /// <inheritdoc />
public IManifest ModManifest { get; internal set; }
/*********
** Public methods
*********/
- /// <summary>The mod entry point, called after the mod is first loaded.</summary>
- /// <param name="helper">Provides simplified APIs for writing mods.</param>
+ /// <inheritdoc />
public abstract void Entry(IModHelper helper);
- /// <summary>Get an API that other mods can access. This is always called after <see cref="Entry"/>.</summary>
- public virtual object GetApi() => null;
+ /// <inheritdoc />
+ public virtual object GetApi()
+ {
+ return null;
+ }
/// <summary>Release or reset unmanaged resources.</summary>
public void Dispose()