PalacePal/Pal.Client/Commands/PalStatsCommand.cs

26 lines
688 B
C#
Raw Normal View History

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