StringTableManager.generated.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. public static Language ActiveLanguage
  21. {
  22. get { return Internal_getActiveLanguage(); }
  23. set { Internal_setActiveLanguage(value); }
  24. }
  25. /// <summary>Returns the string table with the specified id. If the table doesn't exist new one is created.</summary>
  26. /// <param name="id">Identifier of the string table.</param>
  27. /// <returns>String table with the specified identifier.</returns>
  28. public static RRef<StringTable> GetTable(uint id)
  29. {
  30. return Internal_getTable(id);
  31. }
  32. /// <summary>Removes the string table with the specified id.</summary>
  33. /// <param name="id">Identifier of the string table.</param>
  34. public static void RemoveTable(uint id)
  35. {
  36. Internal_removeTable(id);
  37. }
  38. /// <summary>Registers a new string table or replaces an old one at the specified id.</summary>
  39. /// <param name="id">Identifier of the string table.</param>
  40. /// <param name="table">New string table to assign to the specified identifier.</param>
  41. public static void SetTable(uint id, RRef<StringTable> table)
  42. {
  43. Internal_setTable(id, table);
  44. }
  45. [MethodImpl(MethodImplOptions.InternalCall)]
  46. private static extern void Internal_setActiveLanguage(Language language);
  47. [MethodImpl(MethodImplOptions.InternalCall)]
  48. private static extern Language Internal_getActiveLanguage();
  49. [MethodImpl(MethodImplOptions.InternalCall)]
  50. private static extern RRef<StringTable> Internal_getTable(uint id);
  51. [MethodImpl(MethodImplOptions.InternalCall)]
  52. private static extern void Internal_removeTable(uint id);
  53. [MethodImpl(MethodImplOptions.InternalCall)]
  54. private static extern void Internal_setTable(uint id, RRef<StringTable> table);
  55. }
  56. /** @} */
  57. }