Add mock implementation for lua code
This commit is contained in:
parent
06f93e44da
commit
0636205e05
@ -22,6 +22,7 @@ namespace ChaosBot.Models
|
|||||||
|
|
||||||
public enum CustomCommandType
|
public enum CustomCommandType
|
||||||
{
|
{
|
||||||
Basic
|
Basic = 0,
|
||||||
|
CustomLua = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
namespace ChaosBot.Services.ProgrammingLanguageInterpreter
|
||||||
|
{
|
||||||
|
public interface IProgrammingLanguageInterpreter
|
||||||
|
{
|
||||||
|
void Interpret(string content);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user