Esempio n. 1
0
		public EBlockTypes SetNewRandomBlock() {
			if (nextBlockType == EBlockTypes.Empty)
				nextBlockType = (EBlockTypes)(1 + RandomHelper.GetRandomInt(TetrisGrid.NumOfBlockTypes - 1));

			EBlockTypes currentBlockType = nextBlockType;
			nextBlockType = (EBlockTypes)(1 + RandomHelper.GetRandomInt(TetrisGrid.NumOfBlockTypes - 1));

			return currentBlockType;
		}
Esempio n. 2
0
        public EBlockTypes SetNewRandomBlock()
        {
            if (nextBlockType == EBlockTypes.Empty)
            {
                nextBlockType = (EBlockTypes)(1 + RandomHelper.GetRandomInt(TetrisGrid.NumOfBlockTypes - 1));
            }

            EBlockTypes currentBlockType = nextBlockType;

            nextBlockType = (EBlockTypes)(1 + RandomHelper.GetRandomInt(TetrisGrid.NumOfBlockTypes - 1));

            return(currentBlockType);
        }