From 32d36144a45b19089e56029bd4f3ec11b6de517a Mon Sep 17 00:00:00 2001 From: Ahmed Zamil Date: Sat, 12 Feb 2022 15:39:02 +0300 Subject: [PATCH] WS2 --- lib/src/Core/IEventHandler.dart | 12 ++++++++---- lib/src/Core/PropertyModificationInfo.dart | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 lib/src/Core/PropertyModificationInfo.dart diff --git a/lib/src/Core/IEventHandler.dart b/lib/src/Core/IEventHandler.dart index 35d6434..3c3a18f 100644 --- a/lib/src/Core/IEventHandler.dart +++ b/lib/src/Core/IEventHandler.dart @@ -1,7 +1,10 @@ import 'dart:async'; +import 'PropertyModificationInfo.dart'; + class IEventHandler { - final _propertyModifiedController = StreamController(); + final _propertyModifiedController = + StreamController(); Map> _events = {}; @@ -11,10 +14,11 @@ class IEventHandler { IEventHandler() {} - Stream get properyModified => _propertyModifiedController.stream; + Stream get properyModified => + _propertyModifiedController.stream; - emitProperty(String name) { - _propertyModifiedController.add(name); + emitProperty(PropertyModificationInfo event) { + _propertyModifiedController.add(event); } emitArgs(String event, List arguments) { diff --git a/lib/src/Core/PropertyModificationInfo.dart b/lib/src/Core/PropertyModificationInfo.dart new file mode 100644 index 0000000..01250c1 --- /dev/null +++ b/lib/src/Core/PropertyModificationInfo.dart @@ -0,0 +1,14 @@ +import '../Resource/IResource.dart'; +import '../Resource/Template/PropertyTemplate.dart'; + +class PropertyModificationInfo { + final PropertyTemplate propertyTemplate; + final value; + final int age; + final IResource resource; + + String get name => propertyTemplate.name; + + PropertyModificationInfo( + this.resource, this.propertyTemplate, this.value, this.age); +}