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); } }
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); } }