diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-15 18:48:31 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-01-15 18:48:31 -0500 |
commit | 812251e7ae532d7a2f10d46ff366bf19e67e88d0 (patch) | |
tree | 88b88fc13c5b19dfa1a2742dda3e43bd1e2eee4a /src/SMAPI/Utilities | |
parent | a9b99c12069bfabca81a74c83eda7f1325c2522a (diff) | |
download | SMAPI-812251e7ae532d7a2f10d46ff366bf19e67e88d0.tar.gz SMAPI-812251e7ae532d7a2f10d46ff366bf19e67e88d0.tar.bz2 SMAPI-812251e7ae532d7a2f10d46ff366bf19e67e88d0.zip |
allow getting all active values from a PerScreen<T> field
Diffstat (limited to 'src/SMAPI/Utilities')
-rw-r--r-- | src/SMAPI/Utilities/PerScreen.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/SMAPI/Utilities/PerScreen.cs b/src/SMAPI/Utilities/PerScreen.cs index 60406d6b..20b8fbce 100644 --- a/src/SMAPI/Utilities/PerScreen.cs +++ b/src/SMAPI/Utilities/PerScreen.cs @@ -47,6 +47,13 @@ namespace StardewModdingAPI.Utilities this.CreateNewState = createNewState ?? (() => default); } + /// <summary>Get all active values by screen ID. This doesn't initialize the value for a screen ID if it's not created yet.</summary> + public IEnumerable<KeyValuePair<int, T>> GetActiveValues() + { + this.RemoveDeadScreens(); + return this.States.ToArray(); + } + /// <summary>Get the value for a given screen ID, creating it if needed.</summary> /// <param name="screenId">The screen ID to check.</param> public T GetValueForScreen(int screenId) |