Add mock implementation for lua code

This commit is contained in:
Daniel_I_Am 2020-09-03 22:37:37 +02:00
parent 06f93e44da
commit 0636205e05
No known key found for this signature in database
GPG Key ID: 80C428FCC9743E84
5 changed files with 58 additions and 2 deletions

View File

@ -22,6 +22,7 @@ namespace ChaosBot.Models
public enum CustomCommandType public enum CustomCommandType
{ {
Basic Basic = 0,
CustomLua = 1
} }
} }

View File

@ -0,0 +1,7 @@
namespace ChaosBot.Services.ProgrammingLanguageInterpreter
{
public interface IProgrammingLanguageInterpreter
{
void Interpret(string content);
}
}

View File

@ -0,0 +1,15 @@
using System;
using NLog;
namespace ChaosBot.Services.ProgrammingLanguageInterpreter
{
internal class LuaProgrammingLanguageInterpreter : IProgrammingLanguageInterpreter
{
private static readonly ILogger Logger = Program.GetLogger();
public void Interpret(string content)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,15 @@
using ChaosBot.Models;
namespace ChaosBot.Services.ProgrammingLanguageInterpreter
{
public static class ProgrammingLanguageInterpreterFacade
{
public static void Interpret(CustomCommand customCommand)
{
IProgrammingLanguageInterpreter interpreter =
ProgrammingLanguageInterpreterFactory.GetInterpreter(customCommand.Type);
interpreter.Interpret(customCommand.Content);
}
}
}

View File

@ -0,0 +1,18 @@
using ChaosBot.Models;
namespace ChaosBot.Services.ProgrammingLanguageInterpreter
{
internal static class ProgrammingLanguageInterpreterFactory
{
public static IProgrammingLanguageInterpreter GetInterpreter(CustomCommandType type)
{
switch (type)
{
case CustomCommandType.CustomLua:
return new LuaProgrammingLanguageInterpreter();
default:
return new LuaProgrammingLanguageInterpreter();
}
}
}
}