/// <summary> /// Initializes a new instance of the <see cref="Board"/> class. /// </summary> /// <param name="repository">The repository<see cref="IStatsRepository"/></param> /// <param name="width">The width<see cref="int"/></param> /// <param name="height">The height<see cref="int"/></param> public Board(IStatsRepository repository, int width, int height) { _repository = repository; _pieceBuilder = new PieceBuilder().OnBoard(this); Dimension = new Size(width, height); Stats = new Stats(); State = new PausedState(); Matrix = new Block[width, height]; Record = _repository.MaxScore(); }
/// <summary> /// The Pause /// </summary> public void Pause() { OnPause?.Invoke(); State = new PausedState(); Stats.Pause(); }