Browse Source

Change function for checking references to property

NX 7 years ago
parent
commit
6b687c1aae
1 changed files with 9 additions and 7 deletions
  1. 9 7
      Source/Managed/ENet.cs

+ 9 - 7
Source/Managed/ENet.cs

@@ -259,6 +259,14 @@ namespace ENet {
 			}
 		}
 
+		public bool HasReferences {
+			get {
+				CheckCreated();
+
+				return Native.enet_packet_check_references(nativePacket) != 0;
+			}
+		}
+
 		internal void CheckCreated() {
 			if (nativePacket == IntPtr.Zero)
 				throw new InvalidOperationException("Packet not created");
@@ -305,12 +313,6 @@ namespace ENet {
 			nativePacket = Native.enet_packet_create(data, (IntPtr)length, flags);
 		}
 
-		public bool CheckReferences() {
-			CheckCreated();
-
-			return Native.enet_packet_check_references(nativePacket) != 0;
-		}
-
 		public void CopyTo(byte[] destination) {
 			if (destination == null)
 				throw new ArgumentNullException("destination");
@@ -983,4 +985,4 @@ namespace ENet {
 		[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
 		internal static extern void enet_peer_reset(IntPtr peer);
 	}
-}
+}