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; }
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); }