uint24_t.cs 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.1
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. namespace RakNet {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. #pragma warning disable 0660
  12. public class uint24_t : IDisposable {
  13. private HandleRef swigCPtr;
  14. protected bool swigCMemOwn;
  15. internal uint24_t(IntPtr cPtr, bool cMemoryOwn) {
  16. swigCMemOwn = cMemoryOwn;
  17. swigCPtr = new HandleRef(this, cPtr);
  18. }
  19. internal static HandleRef getCPtr(uint24_t obj) {
  20. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  21. }
  22. ~uint24_t() {
  23. Dispose();
  24. }
  25. public virtual void Dispose() {
  26. lock(this) {
  27. if (swigCPtr.Handle != IntPtr.Zero) {
  28. if (swigCMemOwn) {
  29. swigCMemOwn = false;
  30. RakNetPINVOKE.delete_uint24_t(swigCPtr);
  31. }
  32. swigCPtr = new HandleRef(null, IntPtr.Zero);
  33. }
  34. GC.SuppressFinalize(this);
  35. }
  36. }
  37. public override int GetHashCode()
  38. {
  39. return (int)this.val;
  40. }
  41. public static implicit operator uint24_t(uint inUint)
  42. {
  43. return new uint24_t(inUint);
  44. }
  45. public static bool operator ==(uint24_t a, uint24_t b)
  46. {
  47. // If both are null, or both are same instance, return true.
  48. if (System.Object.ReferenceEquals(a, b))
  49. {
  50. return true;
  51. }
  52. // If one is null, but not both, return false.
  53. if (((object)a == null) || ((object)b == null))
  54. {
  55. return false;
  56. }
  57. return a.Equals(b);//Equals should be overloaded as well
  58. }
  59. public static bool operator !=(uint24_t a, uint24_t b)
  60. {
  61. return a.OpNotEqual(b);
  62. }
  63. public static bool operator < (uint24_t a, uint24_t b)
  64. {
  65. return a.OpLess(b);
  66. }
  67. public static bool operator >(uint24_t a, uint24_t b)
  68. {
  69. return a.OpGreater(b);
  70. }
  71. public static uint24_t operator +(uint24_t a, uint24_t b)
  72. {
  73. return a.OpPlus(b);
  74. }
  75. public static uint24_t operator ++(uint24_t a)
  76. {
  77. return a.OpPlusPlus();
  78. }
  79. public static uint24_t operator --(uint24_t a)
  80. {
  81. return a.OpMinusMinus();
  82. }
  83. public static uint24_t operator *(uint24_t a, uint24_t b)
  84. {
  85. return a.OpMultiply(b);
  86. }
  87. public static uint24_t operator /(uint24_t a, uint24_t b)
  88. {
  89. return a.OpDivide(b);
  90. }
  91. public static uint24_t operator -(uint24_t a, uint24_t b)
  92. {
  93. return a.OpMinus(b);
  94. }
  95. //------------
  96. public static bool operator ==(uint24_t a, uint b)
  97. {
  98. // If both are null, or both are same instance, return true.
  99. if (System.Object.ReferenceEquals(a, b))
  100. {
  101. return true;
  102. }
  103. // If one is null, but not both, return false.
  104. if (((object)a == null) || ((object)b == null))
  105. {
  106. return false;
  107. }
  108. return a.Equals(b);//Equals should be overloaded as well
  109. }
  110. public static bool operator !=(uint24_t a, uint b)
  111. {
  112. return a.OpNotEqual(b);
  113. }
  114. public static bool operator < (uint24_t a, uint b)
  115. {
  116. return a.OpLess(b);
  117. }
  118. public static bool operator >(uint24_t a, uint b)
  119. {
  120. return a.OpGreater(b);
  121. }
  122. public static uint24_t operator +(uint24_t a, uint b)
  123. {
  124. return a.OpPlus(b);
  125. }
  126. public static uint24_t operator *(uint24_t a, uint b)
  127. {
  128. return a.OpMultiply(b);
  129. }
  130. public static uint24_t operator /(uint24_t a, uint b)
  131. {
  132. return a.OpDivide(b);
  133. }
  134. public static uint24_t operator -(uint24_t a, uint b)
  135. {
  136. return a.OpMinus(b);
  137. }
  138. public override string ToString()
  139. {
  140. return val.ToString();
  141. }
  142. public uint val {
  143. set {
  144. RakNetPINVOKE.uint24_t_val_set(swigCPtr, value);
  145. }
  146. get {
  147. uint ret = RakNetPINVOKE.uint24_t_val_get(swigCPtr);
  148. return ret;
  149. }
  150. }
  151. public uint24_t() : this(RakNetPINVOKE.new_uint24_t__SWIG_0(), true) {
  152. }
  153. public uint24_t(uint24_t a) : this(RakNetPINVOKE.new_uint24_t__SWIG_1(uint24_t.getCPtr(a)), true) {
  154. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  155. }
  156. private uint24_t OpPlusPlus() {
  157. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpPlusPlus(swigCPtr), true);
  158. return ret;
  159. }
  160. private uint24_t OpMinusMinus() {
  161. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpMinusMinus(swigCPtr), true);
  162. return ret;
  163. }
  164. public uint24_t CopyData(uint24_t a) {
  165. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_CopyData__SWIG_0(swigCPtr, uint24_t.getCPtr(a)), false);
  166. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  167. return ret;
  168. }
  169. public bool Equals(uint24_t right) {
  170. bool ret = RakNetPINVOKE.uint24_t_Equals__SWIG_0(swigCPtr, uint24_t.getCPtr(right));
  171. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  172. return ret;
  173. }
  174. private bool OpNotEqual(uint24_t right) {
  175. bool ret = RakNetPINVOKE.uint24_t_OpNotEqual__SWIG_0(swigCPtr, uint24_t.getCPtr(right));
  176. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  177. return ret;
  178. }
  179. private bool OpGreater(uint24_t right) {
  180. bool ret = RakNetPINVOKE.uint24_t_OpGreater__SWIG_0(swigCPtr, uint24_t.getCPtr(right));
  181. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  182. return ret;
  183. }
  184. private bool OpLess(uint24_t right) {
  185. bool ret = RakNetPINVOKE.uint24_t_OpLess__SWIG_0(swigCPtr, uint24_t.getCPtr(right));
  186. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  187. return ret;
  188. }
  189. private uint24_t OpPlus(uint24_t other) {
  190. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpPlus__SWIG_0(swigCPtr, uint24_t.getCPtr(other)), true);
  191. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  192. return ret;
  193. }
  194. private uint24_t OpMinus(uint24_t other) {
  195. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpMinus__SWIG_0(swigCPtr, uint24_t.getCPtr(other)), true);
  196. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  197. return ret;
  198. }
  199. private uint24_t OpDivide(uint24_t other) {
  200. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpDivide__SWIG_0(swigCPtr, uint24_t.getCPtr(other)), true);
  201. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  202. return ret;
  203. }
  204. private uint24_t OpMultiply(uint24_t other) {
  205. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpMultiply__SWIG_0(swigCPtr, uint24_t.getCPtr(other)), true);
  206. if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  207. return ret;
  208. }
  209. public uint24_t(uint a) : this(RakNetPINVOKE.new_uint24_t__SWIG_2(a), true) {
  210. }
  211. public uint24_t CopyData(uint a) {
  212. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_CopyData__SWIG_1(swigCPtr, a), false);
  213. return ret;
  214. }
  215. public bool Equals(uint right) {
  216. bool ret = RakNetPINVOKE.uint24_t_Equals__SWIG_1(swigCPtr, right);
  217. return ret;
  218. }
  219. private bool OpNotEqual(uint right) {
  220. bool ret = RakNetPINVOKE.uint24_t_OpNotEqual__SWIG_1(swigCPtr, right);
  221. return ret;
  222. }
  223. private bool OpGreater(uint right) {
  224. bool ret = RakNetPINVOKE.uint24_t_OpGreater__SWIG_1(swigCPtr, right);
  225. return ret;
  226. }
  227. private bool OpLess(uint right) {
  228. bool ret = RakNetPINVOKE.uint24_t_OpLess__SWIG_1(swigCPtr, right);
  229. return ret;
  230. }
  231. private uint24_t OpPlus(uint other) {
  232. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpPlus__SWIG_1(swigCPtr, other), true);
  233. return ret;
  234. }
  235. private uint24_t OpMinus(uint other) {
  236. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpMinus__SWIG_1(swigCPtr, other), true);
  237. return ret;
  238. }
  239. private uint24_t OpDivide(uint other) {
  240. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpDivide__SWIG_1(swigCPtr, other), true);
  241. return ret;
  242. }
  243. private uint24_t OpMultiply(uint other) {
  244. uint24_t ret = new uint24_t(RakNetPINVOKE.uint24_t_OpMultiply__SWIG_1(swigCPtr, other), true);
  245. return ret;
  246. }
  247. }
  248. }
粤ICP备19079148号