Пример #1
0
 public void RegisterDelegate(ENPCType type, NPCHandle handle)
 {
     if (eventMap.ContainsKey(type))
     {
         eventMap[type] += handle;
     }
     else
     {
         eventMap[type] = handle;
     }
 }
Пример #2
0
        public bool TryNpcResponse(int id)
        {
            NPCDefine define = null;

            if (!Managers.DataManager.Instance.NPCs.TryGetValue(id, out define))
            {
                return(false);
            }
            NPCHandle handle = null;

            if (!eventMap.TryGetValue(define.Type, out handle))
            {
                return(false);
            }
            if (handle == null)
            {
                return(false);
            }

            return(handle(define));
        }