private Piece CreatePiece(Tetromino next) { Score += ScorePerPiece; PieceCount++; return(new Piece(this, next) { Position = new VectorInt2(Width / 2, 0), Rotation = 0 }); }
public void Load(TetrisGameStateDto dto) { floor = Matrix2 <Tetromino> .Create(dto.Floor, Tetromino.GetByChar); State = dto.State; Active = new Piece(this, Tetromino.All.First(x => x.Name == dto.ActiveT)) { Position = new VectorInt2(dto.ActiveX, dto.ActiveY), Rotation = dto.ActiveR }; Speed = dto.Speed; Score = dto.Score; Next = Tetromino.GetByChar(dto.NextT); }
public Piece(TetrisGame game, Tetromino tetromino) { Game = game; Tetromino = tetromino; }