public void Register <T>(int responseId, Action <T> handler) where T : class, DataObject, new() { var nrcb = new NetRecivedCallBack <T>(handler); handlerDic.Add(responseId, nrcb); }
public void Unregister(Proto proto, Action <DDNode> handler) { var hl = TryGetHandlerList(proto.route); if (hl != null) { var nrcb = new NetRecivedCallBack(proto.s2cdt, handler); if (!hl.Remove(nrcb)) { Logger.Error("Unregister failed! , Not Existed Callback"); } } else { Logger.Error("Unregister failed!"); } }
internal void Unregister <T>(string route, Action <T> handler) where T : class, DataObject, new() { var hl = TryGetHandlerList(route); if (hl != null) { var nrcb = new NetRecivedCallBack <T>(handler); if (!hl.Remove(nrcb)) { Logger.Error("Unregister failed! , Not Existed Callback"); } } else { Logger.Error("Unregister failed!"); } }
public void Register(Proto proto, Action <DDNode> handler) { var hl = TryGetHandlerList(proto.route); if (hl == null) { hl = new List <INetRecivedCallBack>(); pushHandlerDic.Add(proto.route, hl); } var nrcb = new NetRecivedCallBack(proto.s2cdt, handler); if (hl.Contains(nrcb)) { Logger.Error("Register Duplicate!"); } else { hl.Add(nrcb); } }
internal void Register <T>(string route, Action <T> handler) where T : class, DataObject, new() { var hl = TryGetHandlerList(route); if (hl == null) { hl = new List <INetRecivedCallBack>(); pushHandlerDic.Add(route, hl); } var nrcb = new NetRecivedCallBack <T>(handler); if (hl.Contains(nrcb)) { Logger.Error("Register Duplicate!"); } else { hl.Add(nrcb); } }
public void Register(int responseId, Proto proto, Action <DDNode> handler) { var nrcb = new NetRecivedCallBack(proto.s2cdt, handler); handlerDic.Add(responseId, nrcb); }