Пример #1
0
        public void MoveTheseus(Directions direction)
        {
            switch (direction)
            {
            case Directions.UP:     //UP
                if (getSquare(TheseusColumn, TheseusRow).Top)
                {
                    break;
                }
                else
                {
                    Moveable theseusMove = new Moveable(TheseusColumn, TheseusRow, this);
                    int[]    move        = theseusMove.GoUp();
                    currentLevel.levelLayout[TheseusColumn, TheseusRow].theseusLeftSquare();
                    currentLevel.levelLayout[move[1], move[0]].theseusEnteredSquare();
                    TheseusRow    = move[0];
                    TheseusColumn = move[1];
                    MoveCount    += 1;
                    break;
                }

            case Directions.DOWN:     //DOWN
                if (getSquare(TheseusColumn, TheseusRow).Bottom)
                {
                    break;
                }
                else
                {
                    Moveable theseusMove = new Moveable(TheseusColumn, TheseusRow, this);
                    int[]    move        = theseusMove.GoDown();
                    currentLevel.levelLayout[TheseusColumn, TheseusRow].theseusLeftSquare();
                    currentLevel.levelLayout[move[1], move[0]].theseusEnteredSquare();
                    TheseusRow    = move[0];
                    TheseusColumn = move[1];
                    MoveCount    += 1;
                    break;
                }

            case Directions.LEFT:     //LEFT
                if (getSquare(TheseusColumn, TheseusRow).Left)
                {
                    break;
                }
                else
                {
                    Moveable theseusMove = new Moveable(TheseusColumn, TheseusRow, this);
                    int[]    move        = theseusMove.GoLeft();
                    currentLevel.levelLayout[TheseusColumn, TheseusRow].theseusLeftSquare();
                    currentLevel.levelLayout[move[1], move[0]].theseusEnteredSquare();
                    TheseusRow    = move[0];
                    TheseusColumn = move[1];
                    MoveCount    += 1;
                    break;
                }

            case Directions.RIGHT:     //RIGHT
                if (getSquare(TheseusColumn, TheseusRow).Right)
                {
                    break;
                }
                else
                {
                    Moveable theseusMove = new Moveable(TheseusColumn, TheseusRow, this);
                    int[]    move        = theseusMove.GoRight();
                    currentLevel.levelLayout[TheseusColumn, TheseusRow].theseusLeftSquare();
                    currentLevel.levelLayout[move[1], move[0]].theseusEnteredSquare();
                    TheseusRow    = move[0];
                    TheseusColumn = move[1];
                    MoveCount    += 1;
                    break;
                }

            case Directions.PAUSE:     //PAUSE
                MoveCount += 1;
                break;
            }
            HasTheseusEscaped();
            CheckForMinotaurWon();
        }