TileMapLayer2D.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // TileMapLayer2D.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 component.
  21. /// </summary>
  22. public unsafe partial class TileMapLayer2D : Component
  23. {
  24. unsafe partial void OnTileMapLayer2DCreated ();
  25. [Preserve]
  26. public TileMapLayer2D (IntPtr handle) : base (handle)
  27. {
  28. OnTileMapLayer2DCreated ();
  29. }
  30. [Preserve]
  31. protected TileMapLayer2D (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnTileMapLayer2DCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int TileMapLayer2D_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (TileMapLayer2D_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr TileMapLayer2D_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (TileMapLayer2D_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int TileMapLayer2D_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(TileMapLayer2D));
  54. return new StringHash (TileMapLayer2D_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr TileMapLayer2D_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(TileMapLayer2D));
  61. return Marshal.PtrToStringAnsi (TileMapLayer2D_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public TileMapLayer2D () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr TileMapLayer2D_TileMapLayer2D (IntPtr context);
  69. [Preserve]
  70. public TileMapLayer2D (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(TileMapLayer2D));
  73. handle = TileMapLayer2D_TileMapLayer2D ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnTileMapLayer2DCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void TileMapLayer2D_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(TileMapLayer2D));
  85. TileMapLayer2D_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void TileMapLayer2D_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
  89. /// <summary>
  90. /// Add debug geometry to the debug renderer.
  91. /// </summary>
  92. public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. TileMapLayer2D_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void TileMapLayer2D_Initialize (IntPtr handle, IntPtr tileMap, IntPtr tmxLayer);
  99. /// <summary>
  100. /// Initialize with tile map and tmx layer.
  101. /// </summary>
  102. public void Initialize (TileMap2D tileMap, TmxLayer2D tmxLayer)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. TileMapLayer2D_Initialize (handle, (object)tileMap == null ? IntPtr.Zero : tileMap.Handle, (object)tmxLayer == null ? IntPtr.Zero : tmxLayer.Handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void TileMapLayer2D_SetDrawOrder (IntPtr handle, int drawOrder);
  109. /// <summary>
  110. /// Set draw order
  111. /// </summary>
  112. private void SetDrawOrder (int drawOrder)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. TileMapLayer2D_SetDrawOrder (handle, drawOrder);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void TileMapLayer2D_SetVisible (IntPtr handle, bool visible);
  119. /// <summary>
  120. /// Set visible.
  121. /// </summary>
  122. private void SetVisible (bool visible)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. TileMapLayer2D_SetVisible (handle, visible);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern IntPtr TileMapLayer2D_GetTileMap (IntPtr handle);
  129. /// <summary>
  130. /// Return tile map.
  131. /// </summary>
  132. private TileMap2D GetTileMap ()
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. return Runtime.LookupObject<TileMap2D> (TileMapLayer2D_GetTileMap (handle));
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern IntPtr TileMapLayer2D_GetTmxLayer (IntPtr handle);
  139. /// <summary>
  140. /// Return tmx layer.
  141. /// </summary>
  142. private TmxLayer2D GetTmxLayer ()
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. return Runtime.LookupRefCounted<TmxLayer2D> (TileMapLayer2D_GetTmxLayer (handle));
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern int TileMapLayer2D_GetDrawOrder (IntPtr handle);
  149. /// <summary>
  150. /// Return draw order.
  151. /// </summary>
  152. private int GetDrawOrder ()
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. return TileMapLayer2D_GetDrawOrder (handle);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern bool TileMapLayer2D_IsVisible (IntPtr handle);
  159. /// <summary>
  160. /// Return visible.
  161. /// </summary>
  162. private bool IsVisible ()
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. return TileMapLayer2D_IsVisible (handle);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern bool TileMapLayer2D_HasProperty (IntPtr handle, string name);
  169. /// <summary>
  170. /// Return has property
  171. /// </summary>
  172. public bool HasProperty (string name)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. return TileMapLayer2D_HasProperty (handle, name);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern IntPtr TileMapLayer2D_GetProperty (IntPtr handle, string name);
  179. /// <summary>
  180. /// Return property.
  181. /// </summary>
  182. public string GetProperty (string name)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. return Marshal.PtrToStringAnsi (TileMapLayer2D_GetProperty (handle, name));
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern TileMapLayerType2D TileMapLayer2D_GetLayerType (IntPtr handle);
  189. /// <summary>
  190. /// Return layer type.
  191. /// </summary>
  192. private TileMapLayerType2D GetLayerType ()
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. return TileMapLayer2D_GetLayerType (handle);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern int TileMapLayer2D_GetWidth (IntPtr handle);
  199. /// <summary>
  200. /// Return width (for tile layer only).
  201. /// </summary>
  202. private int GetWidth ()
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. return TileMapLayer2D_GetWidth (handle);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern int TileMapLayer2D_GetHeight (IntPtr handle);
  209. /// <summary>
  210. /// Return height (for tile layer only).
  211. /// </summary>
  212. private int GetHeight ()
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. return TileMapLayer2D_GetHeight (handle);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern IntPtr TileMapLayer2D_GetTileNode (IntPtr handle, int x, int y);
  219. /// <summary>
  220. /// Return tile node (for tile layer only).
  221. /// </summary>
  222. public Node GetTileNode (int x, int y)
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. return Runtime.LookupObject<Node> (TileMapLayer2D_GetTileNode (handle, x, y));
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern IntPtr TileMapLayer2D_GetTile (IntPtr handle, int x, int y);
  229. /// <summary>
  230. /// Return tile (for tile layer only).
  231. /// </summary>
  232. public Tile2D GetTile (int x, int y)
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. return Runtime.LookupRefCounted<Tile2D> (TileMapLayer2D_GetTile (handle, x, y));
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern uint TileMapLayer2D_GetNumObjects (IntPtr handle);
  239. /// <summary>
  240. /// Return number of tile map objects (for object group only).
  241. /// </summary>
  242. private uint GetNumObjects ()
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. return TileMapLayer2D_GetNumObjects (handle);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern IntPtr TileMapLayer2D_GetObject (IntPtr handle, uint index);
  249. /// <summary>
  250. /// Return tile map object (for object group only).
  251. /// </summary>
  252. public TileMapObject2D GetObject (uint index)
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. return Runtime.LookupRefCounted<TileMapObject2D> (TileMapLayer2D_GetObject (handle, index));
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern IntPtr TileMapLayer2D_GetObjectNode (IntPtr handle, uint index);
  259. /// <summary>
  260. /// Return object node (for object group only).
  261. /// </summary>
  262. public Node GetObjectNode (uint index)
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. return Runtime.LookupObject<Node> (TileMapLayer2D_GetObjectNode (handle, index));
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern IntPtr TileMapLayer2D_GetImageNode (IntPtr handle);
  269. /// <summary>
  270. /// Return image node (for image layer only).
  271. /// </summary>
  272. private Node GetImageNode ()
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. return Runtime.LookupObject<Node> (TileMapLayer2D_GetImageNode (handle));
  276. }
  277. public override StringHash Type {
  278. get {
  279. return UrhoGetType ();
  280. }
  281. }
  282. public override string TypeName {
  283. get {
  284. return GetTypeName ();
  285. }
  286. }
  287. [Preserve]
  288. public new static StringHash TypeStatic {
  289. get {
  290. return GetTypeStatic ();
  291. }
  292. }
  293. public new static string TypeNameStatic {
  294. get {
  295. return GetTypeNameStatic ();
  296. }
  297. }
  298. /// <summary>
  299. /// Return draw order.
  300. /// Or
  301. /// Set draw order
  302. /// </summary>
  303. public int DrawOrder {
  304. get {
  305. return GetDrawOrder ();
  306. }
  307. set {
  308. SetDrawOrder (value);
  309. }
  310. }
  311. /// <summary>
  312. /// Return visible.
  313. /// Or
  314. /// Set visible.
  315. /// </summary>
  316. public bool Visible {
  317. get {
  318. return IsVisible ();
  319. }
  320. set {
  321. SetVisible (value);
  322. }
  323. }
  324. /// <summary>
  325. /// Return tile map.
  326. /// </summary>
  327. public TileMap2D TileMap {
  328. get {
  329. return GetTileMap ();
  330. }
  331. }
  332. /// <summary>
  333. /// Return tmx layer.
  334. /// </summary>
  335. public TmxLayer2D TmxLayer {
  336. get {
  337. return GetTmxLayer ();
  338. }
  339. }
  340. /// <summary>
  341. /// Return layer type.
  342. /// </summary>
  343. public TileMapLayerType2D LayerType {
  344. get {
  345. return GetLayerType ();
  346. }
  347. }
  348. /// <summary>
  349. /// Return width (for tile layer only).
  350. /// </summary>
  351. public int Width {
  352. get {
  353. return GetWidth ();
  354. }
  355. }
  356. /// <summary>
  357. /// Return height (for tile layer only).
  358. /// </summary>
  359. public int Height {
  360. get {
  361. return GetHeight ();
  362. }
  363. }
  364. /// <summary>
  365. /// Return number of tile map objects (for object group only).
  366. /// </summary>
  367. public uint NumObjects {
  368. get {
  369. return GetNumObjects ();
  370. }
  371. }
  372. /// <summary>
  373. /// Return image node (for image layer only).
  374. /// </summary>
  375. public Node ImageNode {
  376. get {
  377. return GetImageNode ();
  378. }
  379. }
  380. }
  381. }