๐Ÿ“ฆ sleepyfran / duets

๐Ÿ“„ BandInventory.Command.fs ยท 25 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25namespace Duets.Cli.Components.Commands

open Duets.Cli.Components
open Duets.Cli.SceneIndex
open Duets.Cli.Text
open Duets.Common
open Duets.Entities

[<RequireQualifiedAccess>]
module BandInventoryCommand =
    /// Command that displays the inventory of the band.
    let create (items: (Item * int<quantity>) list) =
        { Name = "band inventory"
          Description = "Shows all the merchandise your band has in stock"
          Handler =
            (fun _ ->
                "Your band currently has:" |> showMessage

                items
                |> List.iter (fun (item, quantity) ->
                    $"- {quantity} {Generic.simplePluralOf (item.Name |> String.lowercase) quantity |> Styles.item}"
                    |> showMessage)

                Scene.World) }