Engine.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Drawing;
  3. using System.IO;
  4. using NTERA.Core;
  5. using NTERA.EmuEra.Game.EraEmu.Content;
  6. namespace NTERA.Interpreter
  7. {
  8. public class Engine : IScriptEngine
  9. {
  10. public IConsole Console { get; protected set; }
  11. public string EntrypointPath { get; protected set; }
  12. public Interpreter Interpreter { get; protected set; }
  13. public bool Initialize(IConsole console)
  14. {
  15. Console = console;
  16. EntrypointPath = @"M:\era\eraSemifullTest\erb\SYSTEM_TITLE.ERB"; //@"M:\era\eraSemifullTest\erb\TWTITLE.txt";
  17. Interpreter = new Interpreter(console, File.ReadAllText(EntrypointPath));
  18. return true;
  19. }
  20. public void Start()
  21. {
  22. Interpreter.Exec();
  23. }
  24. public void InputString(string input)
  25. {
  26. throw new NotImplementedException();
  27. }
  28. public void InputInteger(long input)
  29. {
  30. throw new NotImplementedException();
  31. }
  32. public void InputSystemInteger(long input)
  33. {
  34. throw new NotImplementedException();
  35. }
  36. public CroppedImage GetImage(string name)
  37. {
  38. var bitmap = new Bitmap(@"M:\era\eraSemifullTest\resources\bbb.png");
  39. return new CroppedImage(name, bitmap, new Rectangle(Point.Empty, bitmap.Size), false);
  40. }
  41. }
  42. }