TmxObjectGroup2D.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // TmxObjectGroup2D.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Urho2D
  18. {
  19. /// <summary>
  20. /// Tmx objects layer.
  21. /// </summary>
  22. public unsafe partial class TmxObjectGroup2D : TmxLayer2D
  23. {
  24. unsafe partial void OnTmxObjectGroup2DCreated ();
  25. [Preserve]
  26. public TmxObjectGroup2D (IntPtr handle) : base (handle)
  27. {
  28. OnTmxObjectGroup2DCreated ();
  29. }
  30. [Preserve]
  31. protected TmxObjectGroup2D (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnTmxObjectGroup2DCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern IntPtr TmxObjectGroup2D_TmxObjectGroup2D (IntPtr tmxFile);
  37. [Preserve]
  38. public TmxObjectGroup2D (TmxFile2D tmxFile) : base (UrhoObjectFlag.Empty)
  39. {
  40. Runtime.Validate (typeof(TmxObjectGroup2D));
  41. handle = TmxObjectGroup2D_TmxObjectGroup2D ((object)tmxFile == null ? IntPtr.Zero : tmxFile.Handle);
  42. Runtime.RegisterObject (this);
  43. OnTmxObjectGroup2DCreated ();
  44. }
  45. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  46. internal static extern bool TmxObjectGroup2D_Load (IntPtr handle, IntPtr element, ref Urho.Urho2D.TileMapInfo2D info);
  47. /// <summary>
  48. /// Load from XML element.
  49. /// </summary>
  50. public bool Load (XmlElement element, Urho.Urho2D.TileMapInfo2D info)
  51. {
  52. Runtime.ValidateRefCounted (this);
  53. return TmxObjectGroup2D_Load (handle, (object)element == null ? IntPtr.Zero : element.Handle, ref info);
  54. }
  55. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  56. internal static extern uint TmxObjectGroup2D_GetNumObjects (IntPtr handle);
  57. /// <summary>
  58. /// Return number of objects.
  59. /// </summary>
  60. private uint GetNumObjects ()
  61. {
  62. Runtime.ValidateRefCounted (this);
  63. return TmxObjectGroup2D_GetNumObjects (handle);
  64. }
  65. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  66. internal static extern IntPtr TmxObjectGroup2D_GetObject (IntPtr handle, uint index);
  67. /// <summary>
  68. /// Return tile map object at index.
  69. /// </summary>
  70. public TileMapObject2D GetObject (uint index)
  71. {
  72. Runtime.ValidateRefCounted (this);
  73. return Runtime.LookupRefCounted<TileMapObject2D> (TmxObjectGroup2D_GetObject (handle, index));
  74. }
  75. /// <summary>
  76. /// Return number of objects.
  77. /// </summary>
  78. public uint NumObjects {
  79. get {
  80. return GetNumObjects ();
  81. }
  82. }
  83. }
  84. }