public async Task StartAnimation() { var configurationGenerator = new RandomCubeConfigurationGenerator(); ISolver solver3x3x3 = new BeginerMethod(); ISolver solver5x5x5 = new SimpleSolver(); var celebrator = new TimeDelayCelebrator(2000); // TODO: LOAD ALL SOLVERS + GENERATORS, GENERATE A CONFIG WITH RANDOM SIZE, PICK A SOLVER BASED ON THE CONFIGURATION GIVEN var random = new Random(); while (true) { var cubeSize = GetCubeSize(random); ISolver solver = cubeSize == 3 ? solver3x3x3 : solver5x5x5; var run = new SolveRun(configurationGenerator, solver, DisplayControl, celebrator, cubeSize); await run.Run().ConfigureAwait(true); } // ReSharper disable once FunctionNeverReturns }
internal static CubeConfiguration<FaceColour> GenerateRandomConfiguration(int cubeSize, int randomRotations) { var generator = new RandomCubeConfigurationGenerator(); var configuration = generator.GenerateConfiguration(cubeSize, randomRotations); return configuration; }
public static IEnumerable<IRotation> GenerateRandomRotations(int numberOfRotations) { var generator = new RandomCubeConfigurationGenerator(); var configuration = generator.GenerateRandomRotationList(numberOfRotations); return configuration; }