public GameState(TetrominoType firstBlock, IGameRules gameRules, IRng rng) { NextTetromino = firstBlock; GameRules = gameRules; Rng = rng; Board = new MutableBoard(gameRules); Time = 0; Level = 0; }
public IBoard LockTetromino(ITetromino tetromino, out int clearedLines) { MutableBoard board = new MutableBoard(this); foreach (var p in GameRules.GetTetrominoPoints(tetromino)) { board.Set(p.x, p.y, tetromino.Type); } clearedLines = board.ClearCompletedLines(); return(board); }