refactor: Refactor code and show different scripting example

- Refactored code so implementation can be shared between Server and
  DdonGameServer.
- Moved settings into settings module and implemented an example using a
  less structured scripting module interface.
- Created new ScriptableSettings class to assist with interacting with
  non-structured settings module.
- Created README.md files for suggestions and guidelines for module
  implementation.
This commit is contained in:
Paul Campbell 2024-12-23 14:40:57 -05:00
parent 62d1d74e0e
commit e6e5073737
24 changed files with 1107 additions and 716 deletions

View file

@ -1,34 +0,0 @@
using Microsoft.CodeAnalysis.Scripting;
using System.Collections.Generic;
using System.IO;
namespace Arrowgene.Ddon.GameServer.Scripting
{
public abstract class ScriptModule
{
public abstract string ModuleRoot { get; }
public abstract string Filter { get; }
public abstract bool ScanSubdirectories { get; }
public FileSystemWatcher Watcher { get; set; }
public HashSet<string> Scripts { get; set; }
public ScriptModule()
{
Scripts = new HashSet<string>();
}
/// <summary>
/// Options passed into the compilation unit.
/// </summary>
/// <returns></returns>
public abstract ScriptOptions Options();
/// <summary>
/// Evaluates the result returned by the script.
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public abstract bool EvaluateResult(ScriptState<object> result);
}
}