From f0ac6d4c4128258abe8bb8d9c7fd27a634d44ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E6=B2=90=E5=91=80?= <163636894+zimuya4153@users.noreply.github.com> Date: Sat, 12 Oct 2024 12:52:04 +0800 Subject: [PATCH] feat: Add isDestroy methods --- lib/GMLIB_API-JS.d.ts | 8 ++++++++ lib/GMLIB_API-JS.js | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/GMLIB_API-JS.d.ts b/lib/GMLIB_API-JS.d.ts index 467b345..bf0f0f1 100644 --- a/lib/GMLIB_API-JS.d.ts +++ b/lib/GMLIB_API-JS.d.ts @@ -1123,6 +1123,11 @@ type PacketData = ( /** 二进制流数据包类 */ declare class GMLIB_BinaryStream { + /** 数据包ID */ + #id: number; + /** 数据包是否被销毁 */ + #destroy: boolean; + constructor( /** 数据包数据 */ data: PacketData[]? @@ -1161,6 +1166,9 @@ declare class GMLIB_BinaryStream { /** 销毁数据包 */ destroy(): GMLIB_BinaryStream; + /** 数据包是否已被销毁 */ + isDestroy(): boolean; + /** 重置数据包 */ reset(): GMLIB_BinaryStream; diff --git a/lib/GMLIB_API-JS.js b/lib/GMLIB_API-JS.js index d127112..1646f1f 100644 --- a/lib/GMLIB_API-JS.js +++ b/lib/GMLIB_API-JS.js @@ -2111,7 +2111,7 @@ class GMLIB_BinaryStream { /** 数据包ID @type {number} */ #id = null; - /** 数据包是否被销毁 */ + /** 数据包是否被销毁 @type {boolean} */ #destroy = false; /** @@ -2185,6 +2185,14 @@ class GMLIB_BinaryStream { return this; } + /** + * 数据包是否已被销毁 + * @returns {boolean} + */ + isDestroy() { + return this.#destroy; + } + /** * 重置数据包 * @returns {GMLIB_BinaryStream}