public void AddModule(Type itfType, IGameModule mod) { CheckInterfaceType(itfType); Type modType = mod.GetType(); if (!itfType.IsAssignableFrom(modType)) { throw new ArgumentException($"Module({modType.Name}) is not implemented by interface({itfType.Name})."); } _modules.Add(itfType, mod); }