TileMapObject2D.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // TileMapObject2D.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. /// Tile map object.
  21. /// </summary>
  22. public unsafe partial class TileMapObject2D : RefCounted
  23. {
  24. public TileMapObject2D (IntPtr handle) : base (handle)
  25. {
  26. }
  27. protected TileMapObject2D (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  28. {
  29. }
  30. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  31. internal static extern IntPtr TileMapObject2D_TileMapObject2D ();
  32. public TileMapObject2D () : base (UrhoObjectFlag.Empty)
  33. {
  34. Runtime.Validate (typeof(TileMapObject2D));
  35. handle = TileMapObject2D_TileMapObject2D ();
  36. Runtime.RegisterObject (this);
  37. }
  38. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  39. internal static extern TileMapObjectType2D TileMapObject2D_GetObjectType (IntPtr handle);
  40. /// <summary>
  41. /// Return type.
  42. /// </summary>
  43. private TileMapObjectType2D GetObjectType ()
  44. {
  45. Runtime.ValidateRefCounted (this);
  46. return TileMapObject2D_GetObjectType (handle);
  47. }
  48. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  49. internal static extern IntPtr TileMapObject2D_GetName (IntPtr handle);
  50. /// <summary>
  51. /// Return name.
  52. /// </summary>
  53. private string GetName ()
  54. {
  55. Runtime.ValidateRefCounted (this);
  56. return Marshal.PtrToStringAnsi (TileMapObject2D_GetName (handle));
  57. }
  58. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  59. internal static extern IntPtr TileMapObject2D_GetType (IntPtr handle);
  60. /// <summary>
  61. /// Return type.
  62. /// </summary>
  63. private string UrhoGetType ()
  64. {
  65. Runtime.ValidateRefCounted (this);
  66. return Marshal.PtrToStringAnsi (TileMapObject2D_GetType (handle));
  67. }
  68. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  69. internal static extern Urho.Vector2 TileMapObject2D_GetPosition (IntPtr handle);
  70. /// <summary>
  71. /// Return position.
  72. /// </summary>
  73. private Urho.Vector2 GetPosition ()
  74. {
  75. Runtime.ValidateRefCounted (this);
  76. return TileMapObject2D_GetPosition (handle);
  77. }
  78. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  79. internal static extern Urho.Vector2 TileMapObject2D_GetSize (IntPtr handle);
  80. /// <summary>
  81. /// Return size (for rectangle and ellipse).
  82. /// </summary>
  83. private Urho.Vector2 GetSize ()
  84. {
  85. Runtime.ValidateRefCounted (this);
  86. return TileMapObject2D_GetSize (handle);
  87. }
  88. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  89. internal static extern uint TileMapObject2D_GetNumPoints (IntPtr handle);
  90. /// <summary>
  91. /// Return number of points (use for script).
  92. /// </summary>
  93. private uint GetNumPoints ()
  94. {
  95. Runtime.ValidateRefCounted (this);
  96. return TileMapObject2D_GetNumPoints (handle);
  97. }
  98. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  99. internal static extern Urho.Vector2 TileMapObject2D_GetPoint (IntPtr handle, uint index);
  100. /// <summary>
  101. /// Return point at index (use for script).
  102. /// </summary>
  103. public Urho.Vector2 GetPoint (uint index)
  104. {
  105. Runtime.ValidateRefCounted (this);
  106. return TileMapObject2D_GetPoint (handle, index);
  107. }
  108. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  109. internal static extern int TileMapObject2D_GetTileGid (IntPtr handle);
  110. /// <summary>
  111. /// Return tile Gid.
  112. /// </summary>
  113. private int GetTileGid ()
  114. {
  115. Runtime.ValidateRefCounted (this);
  116. return TileMapObject2D_GetTileGid (handle);
  117. }
  118. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  119. internal static extern IntPtr TileMapObject2D_GetTileSprite (IntPtr handle);
  120. /// <summary>
  121. /// Return tile sprite.
  122. /// </summary>
  123. private Sprite2D GetTileSprite ()
  124. {
  125. Runtime.ValidateRefCounted (this);
  126. return Runtime.LookupObject<Sprite2D> (TileMapObject2D_GetTileSprite (handle));
  127. }
  128. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  129. internal static extern bool TileMapObject2D_HasProperty (IntPtr handle, string name);
  130. /// <summary>
  131. /// Return has property.
  132. /// </summary>
  133. public bool HasProperty (string name)
  134. {
  135. Runtime.ValidateRefCounted (this);
  136. return TileMapObject2D_HasProperty (handle, name);
  137. }
  138. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  139. internal static extern IntPtr TileMapObject2D_GetProperty (IntPtr handle, string name);
  140. /// <summary>
  141. /// Return property value.
  142. /// </summary>
  143. public string GetProperty (string name)
  144. {
  145. Runtime.ValidateRefCounted (this);
  146. return Marshal.PtrToStringAnsi (TileMapObject2D_GetProperty (handle, name));
  147. }
  148. /// <summary>
  149. /// Return type.
  150. /// </summary>
  151. public TileMapObjectType2D ObjectType {
  152. get {
  153. return GetObjectType ();
  154. }
  155. }
  156. /// <summary>
  157. /// Return name.
  158. /// </summary>
  159. public string Name {
  160. get {
  161. return GetName ();
  162. }
  163. }
  164. /// <summary>
  165. /// Return type.
  166. /// </summary>
  167. public string Type {
  168. get {
  169. return UrhoGetType ();
  170. }
  171. }
  172. /// <summary>
  173. /// Return position.
  174. /// </summary>
  175. public Urho.Vector2 Position {
  176. get {
  177. return GetPosition ();
  178. }
  179. }
  180. /// <summary>
  181. /// Return size (for rectangle and ellipse).
  182. /// </summary>
  183. public Urho.Vector2 Size {
  184. get {
  185. return GetSize ();
  186. }
  187. }
  188. /// <summary>
  189. /// Return number of points (use for script).
  190. /// </summary>
  191. public uint NumPoints {
  192. get {
  193. return GetNumPoints ();
  194. }
  195. }
  196. /// <summary>
  197. /// Return tile Gid.
  198. /// </summary>
  199. public int TileGid {
  200. get {
  201. return GetTileGid ();
  202. }
  203. }
  204. /// <summary>
  205. /// Return tile sprite.
  206. /// </summary>
  207. public Sprite2D TileSprite {
  208. get {
  209. return GetTileSprite ();
  210. }
  211. }
  212. }
  213. }