IKnownEndpoint.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. namespace XUnity.AutoTranslator.Plugin.Core.Web
  7. {
  8. public interface IKnownEndpoint
  9. {
  10. /// <summary>
  11. /// Attempt to translated the provided untranslated text. Will be used in a "coroutine", so it can be implemented
  12. /// in an async fashion.
  13. /// </summary>
  14. IEnumerator Translate( string untranslatedText, string from, string to, Action<string> success, Action failure );
  15. /// <summary>
  16. /// Gets a boolean indicating if we are allowed to call "Translate".
  17. /// </summary>
  18. bool IsBusy { get; }
  19. /// <summary>
  20. /// Called before plugin shutdown and can return true to prevent plugin shutdown, if the plugin
  21. /// can provide a secondary strategy for translation.
  22. /// </summary>
  23. /// <returns></returns>
  24. bool ShouldGetSecondChanceAfterFailure();
  25. /// <summary>
  26. /// "Update" game loop method.
  27. /// </summary>
  28. void OnUpdate();
  29. }
  30. }