From f3e75f37962dbab1044e9482e4096aeb6ea6d123 Mon Sep 17 00:00:00 2001 From: Ahmed Zamil Date: Sun, 2 Jul 2023 12:40:12 +0300 Subject: [PATCH] enum --- lib/src/Data/DataSerializer.dart | 2 +- lib/src/Resource/Instance.dart | 5 +++++ lib/src/Resource/Warehouse.dart | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/src/Data/DataSerializer.dart b/lib/src/Data/DataSerializer.dart index 1c1f938..f1e9331 100644 --- a/lib/src/Data/DataSerializer.dart +++ b/lib/src/Data/DataSerializer.dart @@ -122,7 +122,7 @@ class DataSerializer { return DataSerializerComposeResults( TransmissionTypeIdentifier.Null, DC(0)); - var cts = template.constants.where((x) => x.value == value); + var cts = template.constants.where((x) => x.value == value.value); if (cts.isEmpty) return DataSerializerComposeResults( diff --git a/lib/src/Resource/Instance.dart b/lib/src/Resource/Instance.dart index a999620..20e9c75 100644 --- a/lib/src/Resource/Instance.dart +++ b/lib/src/Resource/Instance.dart @@ -45,6 +45,10 @@ class Instance extends IEventHandler { int _id; + bool _isDestroyed; + + bool get isDestroyed => _isDestroyed; + /// /// Instance attributes are custom properties associated with the instance, a place to store information by IStore. /// @@ -619,6 +623,7 @@ class Instance extends IEventHandler { } void resource_OnDestroy(sender) { + _isDestroyed = true; emitArgs("resourceDestroyed", [sender]); } } diff --git a/lib/src/Resource/Warehouse.dart b/lib/src/Resource/Warehouse.dart index 8d87305..cfadfdc 100644 --- a/lib/src/Resource/Warehouse.dart +++ b/lib/src/Resource/Warehouse.dart @@ -670,6 +670,8 @@ class Warehouse { resource.destroy(); + resource.instance = null; + return true; }