StringTableManager.generated.cs 2.2 KB

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