Files
reallife-gamemode/ReallifeGamemode.Server.Core/Commands/Command.cs
2020-03-29 13:58:50 +02:00

29 lines
743 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.Logging;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Core.API;
using ReallifeGamemode.Server.Log;
namespace ReallifeGamemode.Server.Core.Commands
{
public abstract class Command
{
public abstract bool CanExecute(IPlayer player);
protected IAPI Api => Main.API;
protected ILogger Log { get; set; }
public abstract string CommandName { get; }
public virtual string HelpText { get; } = null;
public Command()
{
Log = LogManager.GetLogger(this.GetType());
}
protected DatabaseContext GetDbContext(bool useLoggerFactory = true) => Main.GetDbContext(useLoggerFactory);
}
}