EluciusFTW.Tuisweeper
0.1.3
dotnet add package EluciusFTW.Tuisweeper --version 0.1.3
NuGet\Install-Package EluciusFTW.Tuisweeper -Version 0.1.3
<PackageReference Include="EluciusFTW.Tuisweeper" Version="0.1.3" />
<PackageVersion Include="EluciusFTW.Tuisweeper" Version="0.1.3" />
<PackageReference Include="EluciusFTW.Tuisweeper" />
paket add EluciusFTW.Tuisweeper --version 0.1.3
#r "nuget: EluciusFTW.Tuisweeper, 0.1.3"
#:package EluciusFTW.Tuisweeper@0.1.3
#addin nuget:?package=EluciusFTW.Tuisweeper&version=0.1.3
#tool nuget:?package=EluciusFTW.Tuisweeper&version=0.1.3
EluciusFTW.Tuisweeper
Minesweeper as an Elmish component for SpectreTuff.Elmish programs. Host it as a whole app, or embed it in your own, for example as a pop-up game.
Hosting the component
open Tuisweeper
// Highscores: Store.defaultFile (shared with the standalone game), Store.file path,
// Store.none, or your own { Load = ...; Save = ... }.
let deps = Tuisweeper.Dependencies.create Highscore.Store.defaultFile
let init () = Tuisweeper.init deps
let update msg model =
let model, cmd, out = Tuisweeper.update deps msg model
match out with
| Some Tuisweeper.Closed -> model, Cmd.batch [ cmd; TuiCmd.exit ] // the player pressed q or Esc
| None -> model, cmd
Elmish.Program.mkProgram init update Tuisweeper.view
|> Elmish.Program.withSubscription (fun model ->
Subscriptions.keys Tuisweeper.InputMsg @ Tuisweeper.subscriptions model)
|> Tui.run
When embedding, wrap the component's messages in your own (SweeperMsg of Tuisweeper.Msg), route key
presses to it as Tuisweeper.InputMsg key, render Tuisweeper.view on top of your view, and decide
what Closed means, e.g. hiding the overlay instead of exiting.
See src/Tuigames.Cli in this repository for a host that embeds this and other games behind a menu.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- EluciusFTW.SpectreTuff (>= 0.14.14)
- EluciusFTW.SpectreTuff.Elmish (>= 0.14.14)
- FSharp.Core (>= 10.1.402)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.