StringTableManager.generated.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Localization
  7. * @{
  8. */
  9. /// <summary>
  10. /// Manages string tables used for localizing text. Allows you to add and remove different tables and change the active
  11. /// language.
  12. /// </summary>
  13. [ShowInInspector]
  14. public partial class StringTables : ScriptObject
  15. {
  16. private StringTables(bool __dummy0) { }
  17. protected StringTables() { }
  18. /// <summary>Determines the currently active language. Any newly created strings will use this value.</summary>
  19. [ShowInInspector]
  20. [NativeWrapper]
  21. public static Language ActiveLanguage
  22. {
  23. get { return Internal_getActiveLanguage(); }
  24. set { Internal_setActiveLanguage(value); }
  25. }
  26. /// <summary>Returns the string table with the specified id. If the table doesn't exist new one is created.</summary>
  27. /// <param name="id">Identifier of the string table.</param>
  28. /// <returns>String table with the specified identifier.</returns>
  29. public static RRef<StringTable> GetTable(uint id)
  30. {
  31. return Internal_getTable(id);
  32. }
  33. /// <summary>Removes the string table with the specified id.</summary>
  34. /// <param name="id">Identifier of the string table.</param>
  35. public static void RemoveTable(uint id)
  36. {
  37. Internal_removeTable(id);
  38. }
  39. /// <summary>Registers a new string table or replaces an old one at the specified id.</summary>
  40. /// <param name="id">Identifier of the string table.</param>
  41. /// <param name="table">New string table to assign to the specified identifier.</param>
  42. public static void SetTable(uint id, RRef<StringTable> table)
  43. {
  44. Internal_setTable(id, table);
  45. }
  46. [MethodImpl(MethodImplOptions.InternalCall)]
  47. private static extern void Internal_setActiveLanguage(Language language);
  48. [MethodImpl(MethodImplOptions.InternalCall)]
  49. private static extern Language Internal_getActiveLanguage();
  50. [MethodImpl(MethodImplOptions.InternalCall)]
  51. private static extern RRef<StringTable> Internal_getTable(uint id);
  52. [MethodImpl(MethodImplOptions.InternalCall)]
  53. private static extern void Internal_removeTable(uint id);
  54. [MethodImpl(MethodImplOptions.InternalCall)]
  55. private static extern void Internal_setTable(uint id, RRef<StringTable> table);
  56. }
  57. /** @} */
  58. }