XSGridEditor  1.0.0
XSGridEditor is a lightweight square grid map system for 2D/3D SRPG games, and comes with a simple and easy-to-use grid editing function. It can be used as a beginning for you to create SRPG games.
Public Member Functions | Private Attributes | List of all members
XSSLG.Emitter< TYPE, T > Class Template Reference

事件分发,给对象之间解耦用的 在一个Emitter里可以为多个事件注册事件回调,每一个事件还可以对应多个回调函数 建议1个Emitter对应同一类的事件类型,防止过于臃肿导致查询耗时 具体用例: More...

Public Member Functions

 Emitter ()
 构造函数 More...
 
void On (TYPE type, T callback, int priority=65536, object target=null)
 为事件注册回调 More...
 
void Emit (TYPE type, params object[] parameters)
 触发事件回调 More...
 
void Off (TYPE type)
 为事件取消回调 More...
 
void Off (TYPE type, T callback)
 为事件取消回调 More...
 
void Off (TYPE type, object target)
 为事件取消回调,如果是匿名函数,就只能用target去查了 More...
 
void Off (object target)
 为事件取消回调 More...
 

Private Attributes

Dictionary< TYPE, EmitterItems< T > > _emitList
 

Detailed Description

事件分发,给对象之间解耦用的 在一个Emitter里可以为多个事件注册事件回调,每一个事件还可以对应多个回调函数 建议1个Emitter对应同一类的事件类型,防止过于臃肿导致查询耗时 具体用例:

Template Parameters
TYPE事件类型,通常是字符串
T回调函数类型
Type Constraints
T :Delegate 

Constructor & Destructor Documentation

◆ Emitter()

XSSLG.Emitter< TYPE, T >.Emitter ( )
inline

构造函数

Member Function Documentation

◆ Emit()

void XSSLG.Emitter< TYPE, T >.Emit ( TYPE  type,
params object[]  parameters 
)
inline

触发事件回调

Template Parameters
type事件类型,通常是字符串
Parameters
parameters事件回调带的参数

◆ Off() [1/4]

void XSSLG.Emitter< TYPE, T >.Off ( object  target)

为事件取消回调

Parameters
target在哪个对象上注册

◆ Off() [2/4]

void XSSLG.Emitter< TYPE, T >.Off ( TYPE  type)
inline

为事件取消回调

Template Parameters
type事件类型,通常是字符串

◆ Off() [3/4]

void XSSLG.Emitter< TYPE, T >.Off ( TYPE  type,
object  target 
)
inline

为事件取消回调,如果是匿名函数,就只能用target去查了

Template Parameters
type事件类型,通常是字符串
Parameters
target在哪个对象上注册

◆ Off() [4/4]

void XSSLG.Emitter< TYPE, T >.Off ( TYPE  type,
callback 
)
inline

为事件取消回调

Template Parameters
type事件类型,通常是字符串
Parameters
callback事件回调

◆ On()

void XSSLG.Emitter< TYPE, T >.On ( TYPE  type,
callback,
int  priority = 65536,
object  target = null 
)
inline

为事件注册回调

Template Parameters
type事件类型,通常是字符串
Parameters
callback事件回调
priority优先级,同一事件中优先级从高到低依次调用
target

Member Data Documentation

◆ _emitList

Dictionary<TYPE, EmitterItems<T> > XSSLG.Emitter< TYPE, T >._emitList
private

The documentation for this class was generated from the following file: