Esempio n. 1
0
        private TetrisState TryRotatePiece(TetrisState state)
        {
            if (State != GameState.Running)
            {
                return(state);
            }

            TryRotatePieceResult result   = BoardLogic.TryRotatePiece(state);
            TetrisState          newState = GetState();

            return(newState);
        }
Esempio n. 2
0
        internal TryRotatePieceResult TryRotatePiece(TetrisState state)
        {
            TryRotatePieceResult result = new TryRotatePieceResult();

            lock (PieceMoveLock) {
                SetState(state);

                if (CanRotatePiece())
                {
                    RotatePiece();
                    result.Rotated = true;
                }
            }

            return(result);
        }