TileMapObject2D.cs 6.2 KB

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