예제 #1
0
        //Метод взаимодействия пользователя и героя
        public void Move(ConsoleKey key)
        {
            IMove moveObj = this.mainHeroy as IMove;

            if (moveObj != null)
            {
                switch (key)
                {
                case ConsoleKey.W:
                    moveObj.MoveUp(this.terrain);
                    break;

                case ConsoleKey.S:
                    moveObj.MoveDown(this.terrain);
                    break;

                case ConsoleKey.A:
                    moveObj.MoveLeft(this.terrain);
                    break;

                case ConsoleKey.D:
                    moveObj.MoveRigth(this.terrain);
                    break;

                default: return;
                }
            }
        }
예제 #2
0
 public void MoveDown()
 {
     _moveImplementation.MoveDown();
 }