Esempio n. 1
0
        public Image MoveInLeftDirection(Image image)
        {
            if (_moveImage.GetType() == typeof(ImageDirectionTop))
            {
                _moveImage = new ImageDirectionRight();
                return(MoveImageInDirection(image));
            }

            if (_moveImage.GetType() == typeof(ImageDirectionRight))
            {
                _moveImage = new ImageDirectionBottom();
                return(MoveImageInDirection(image));
            }

            if (_moveImage.GetType() == typeof(ImageDirectionBottom))
            {
                _moveImage = new ImageDirectionLeft();
                return(MoveImageInDirection(image));
            }

            if (_moveImage.GetType() == typeof(ImageDirectionLeft))
            {
                _moveImage = new ImageDirectionTop();
                return(MoveImageInDirection(image));
            }

            else
            {
                throw new Exception("Unknow Direction");
            }
        }
Esempio n. 2
0
 public MoveImage(IMoveImage moveimage)
 {
     _moveImage = moveimage;
 }