public IAlgorithmGcd GetAlgorithm(GcdAlgorithmType algorithmType) { if (algorithmType == GcdAlgorithmType.Euclidian) { return(new EuclideanGcdAlgorithm()); } return(new StainGcdAlgorithm()); }
private static IAlgorithmGcd GetAlgorithmByType(GcdAlgorithmType algorithmType) { var algorihtmFactory = new GcdAlgorithmFactory(); return(algorihtmFactory.GetAlgorithm(algorithmType)); }
public void CalculateGcd(string userInput, GcdAlgorithmType algorithmType) { var algorithm = GetAlgorithmByType(algorithmType); Result = CalculateGcd(userInput, algorithm); }