public Image MoveImage(Image image) { Console.WriteLine("Choose side"); Console.WriteLine("1 - right; 2 - left"); int value = Int32.Parse(Console.ReadLine()); MoveImage moveImage = new MoveImage(new ImageDirectionTop()); if (value == 1) { while (true) { image = moveImage.MoveInRightDirection(image); Console.WriteLine("If you want to stop move image wright stop"); var val = Console.ReadLine(); if (val.Equals("stop")) { break; } } } if (value == 2) { while (true) { image = moveImage.MoveInLeftDirection(image); Console.WriteLine("If you want to stop move image wright stop"); var val = Console.ReadLine(); if (val.Equals("stop")) { break; } } } return(image); }
public void MoveShape() { MoveImage moveImage = new MoveImage(shape); moveImage.MoveImg(); }