diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-22 20:46:21 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-22 20:46:21 -0400 |
commit | d3fbdf484a4d90365a55fb5058d75a8623f17d0f (patch) | |
tree | c4ada80c72916195398b315457c7310f0ed6dc8f /src/SMAPI/Framework/Events/EventManager.cs | |
parent | a42926868ae5878ed59d6406ca085b587299ba07 (diff) | |
download | SMAPI-d3fbdf484a4d90365a55fb5058d75a8623f17d0f.tar.gz SMAPI-d3fbdf484a4d90365a55fb5058d75a8623f17d0f.tar.bz2 SMAPI-d3fbdf484a4d90365a55fb5058d75a8623f17d0f.zip |
reduce duplicated doc blocks
Diffstat (limited to 'src/SMAPI/Framework/Events/EventManager.cs')
-rw-r--r-- | src/SMAPI/Framework/Events/EventManager.cs | 105 |
1 files changed, 48 insertions, 57 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); - } } } |