EmuEraGameInstance.cs 895 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System.IO;
  2. using NTERA.Core;
  3. using NTERA.EmuEra.Game;
  4. using NTERA.EmuEra.Game.EraEmu.Content;
  5. using NTERA.EmuEra.Game.EraEmu.GameProc;
  6. namespace NTERA.EmuEra
  7. {
  8. public class EmuEraGameInstance : IScriptEngine
  9. {
  10. private Process emuera;
  11. public bool Initialize(IConsole console)
  12. {
  13. emuera = new Process(console);
  14. GlobalStatic.Process = emuera;
  15. GlobalStatic.Console = console;
  16. Program.CMain(Directory.GetCurrentDirectory() + "\\");
  17. return emuera.Initialize();
  18. }
  19. public void Start()
  20. {
  21. emuera.DoScript();
  22. }
  23. public void InputString(string input)
  24. {
  25. emuera.InputString(input);
  26. }
  27. public void InputInteger(long input)
  28. {
  29. emuera.InputInteger(input);
  30. }
  31. public void InputSystemInteger(long input)
  32. {
  33. emuera.InputSystemInteger(input);
  34. }
  35. public CroppedImage GetImage(string name)
  36. {
  37. return AppContents.GetContent(name);
  38. }
  39. }
  40. }