start work to allow customizing command properties via configuration

This commit is contained in:
RaidMax
2020-01-26 18:06:50 -06:00
parent e6bdcc9012
commit 11ae91281f
16 changed files with 1061 additions and 587 deletions

View File

@ -0,0 +1,24 @@
using SharedLibraryCore.Interfaces;
using System;
using System.Collections.Generic;
namespace SharedLibraryCore.Configuration
{
/// <summary>
/// Basic command configuration
/// </summary>
public class CommandConfiguration : IBaseConfiguration
{
/// <summary>
/// Dict of command class names mapped to configurable properties
/// </summary>
public Dictionary<string, CommandProperties> Commands { get; set; } = new Dictionary<string, CommandProperties>();
public IBaseConfiguration Generate()
{
throw new NotImplementedException();
}
public string Name() => nameof(CommandConfiguration);
}
}

View File

@ -0,0 +1,28 @@
using Newtonsoft.Json.Converters;
using System.Text.Json.Serialization;
using static SharedLibraryCore.Database.Models.EFClient;
namespace SharedLibraryCore.Configuration
{
/// <summary>
/// Config driven command properties
/// </summary>
public class CommandProperties
{
/// <summary>
/// Specifies the command name
/// </summary>
public string Name { get; set; }
/// <summary>
/// Alias of this command
/// </summary>
public string Alias { get; set; }
/// <summary>
/// Specifies the minimum permission level needed to execute the
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public Permission MinimumPermission { get; set; }
}
}