EventOption¶
EventOption.
You can create an event option like following code.
1 2 |
|
Functions¶
EventOption EventOption.New()¶
ReturnsA new instance of EventOption.
Returns a new option.
string GetScope()¶
ReturnsThe value of scope.
Gets the value of scope.
The default value is not a string nor nil, and it is strongly recommended to set a new value to scope.
Scope is used as event namespace and event handlers won't be invoked if the event is fired with different scope.
Note: the scope "Yahaha"
has been used to build internal components.
EventOption SetScope(string scope)¶
ReturnsThe option self.
Sets the value of scope.
Note: the scope "Yahaha"
has been used to build internal components.
scope
The new value of scope.
number GetBoundEntityId()¶
ReturnsThe ID of the bounded entity.
Gets the value of ID of the bounded entity.
The default value is not an integer nor nil.
BoundEntityId enables associating events with an entity
and event handler won't be invoked if the event is fired with different entityId.
BoundEntityId can be used with scope at the same time.
EventOption SetBoundEntityId(number entityId)¶
ReturnsThe option self.
Sets the value of ID of the bounded entity.
entityId
The new value of ID of the bounded entity.
boolean IsOnce()¶
ReturnsA boolean value.
Gets the value of the Once property.
If once is true, the registered event handler will be automatically removed after handling an event.
EventOption SetOnce(boolean once)¶
ReturnsThe option self.
Sets the value of the Once property.
once
The new value.