Linkoid.Stardew.Tasks 0.2.0-alpha

This is a prerelease version of Linkoid.Stardew.Tasks.
dotnet add package Linkoid.Stardew.Tasks --version 0.2.0-alpha                
NuGet\Install-Package Linkoid.Stardew.Tasks -Version 0.2.0-alpha                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Linkoid.Stardew.Tasks" Version="0.2.0-alpha">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Linkoid.Stardew.Tasks --version 0.2.0-alpha                
#r "nuget: Linkoid.Stardew.Tasks, 0.2.0-alpha"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Linkoid.Stardew.Tasks as a Cake Addin
#addin nuget:?package=Linkoid.Stardew.Tasks&version=0.2.0-alpha&prerelease

// Install Linkoid.Stardew.Tasks as a Cake Tool
#tool nuget:?package=Linkoid.Stardew.Tasks&version=0.2.0-alpha&prerelease                

Stardew.Tasks

Provides extensions that allow using async methods in Stardew Valley with SMAPI's Event Interfaces. The NuGet package is provided as source code, meaning that Stardew.Tasks is only required at compile time. This means end-users will not need to download Stardew.Tasks.

Example

This example shows how some of the extension methods could be used in an async Entry method.

public override async void Entry(IModHelper helper)
{
    // Log that the mod has been loaded
    this.Monitor.Log("My mod has been loaded!");

    // Wait until all mods have been loaded
    await helper.Events.GameLoop.WaitForGameLaunched(); // Stardew Tasks Extension

    // Get another mod's API
    dynamic contentPatcherApi = helper.ModRegistry.GetApi("Pathoschild.ContentPatcher");

    // Wait for a button press
    var buttonEvent = await helper.Events.Input.WaitForButtonPressed(); // Stardew Tasks Extension

    // Log what the first button pressed was
    string firstButtonName = buttonEvent.Button.ToString();
    this.Monitor.Log($"The first button pressed was '{firstButtonName}'");

    // Create a token that evaluates to the first button pressed
    contentPatcherApi.RegisterToken(this.ModManifest, "FirstButtonPressed", 
        (Func<IEnumerable<string>>)(() => new string[] { firstButtonName }));
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Linkoid.Stardew.Tasks:

Package Downloads
Linkoid.Stardew.ValleyUnit

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.0-alpha 51 8/27/2024
0.1.0-alpha 77 8/13/2024