コード例 #1
0
        void FillHandlers()
        {
            _handlers.Clear();
            var arr = ReflectionUtility.GetSubclasses(typeof(BaseServerMessageHandler));

            foreach (var item in arr)
            {
                var handler = (BaseServerMessageHandler)ReflectionUtility.CreateObjectWithActivator(item);
                _handlers.Add(handler.CommandId, handler);
            }
        }
コード例 #2
0
        void FillHandlers()
        {
            _commands.Clear();
            var arr = ReflectionUtility.GetSubclasses(typeof(ChatCommand));

            foreach (var item in arr)
            {
                var handler = (ChatCommand)ReflectionUtility.CreateObjectWithActivator(item);
                _commands.Add(handler.Keyword, handler);
            }
        }