Hello, Fraysa!
There are many ways to do this. Here's one possibility:
This is just one possibility, but hopefully it gives you an idea of what's possible.
Good luck!
There are many ways to do this. Here's one possibility:
publicabstractclass ScriptBase { protected ScriptEngine _engine { get; privateset; } privatestring _code; publicvirtualvoid Run() { _engine.Execute(_code); } /* ... */ } publicclass NpcScript : ScriptBase { privatevoid SendNext(string text) { /* ... */ } privatevoid SendYesNo(string text) { /* ... */ } publicoverridevoid Run() { _engine.Script.SendNext = new Action<string>(SendNext); _engine.Script.SendYesNo = new Action<string>(SendYesNo); base.Run(); } /* ... */ }
Good luck!