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