PalacePal/Pal.Client/Commands/PalStatsCommand.cs

25 lines
626 B
C#
Raw Permalink Normal View History

using System;
2023-02-24 23:55:48 +00:00
using System.Collections.Generic;
using Pal.Client.DependencyInjection;
2023-03-30 20:01:43 +00:00
namespace Pal.Client.Commands;
internal sealed class PalStatsCommand : ISubCommand
{
2023-03-30 20:01:43 +00:00
private readonly StatisticsService _statisticsService;
public PalStatsCommand(StatisticsService statisticsService)
{
2023-03-30 20:01:43 +00:00
_statisticsService = statisticsService;
}
2023-03-30 20:01:43 +00:00
public IReadOnlyDictionary<string, Action<string>> GetHandlers()
=> new Dictionary<string, Action<string>>
{
2023-03-30 20:01:43 +00:00
{ "stats", _ => Execute() },
};
2023-03-30 20:01:43 +00:00
private void Execute()
=> _statisticsService.ShowGlobalStatistics();
}