Esempio n. 1
0
        public void Clear()
        {
            ClearGameModel();
            _gameScore = 0;
            GameScoreChanged?.Invoke(this, new GameScoreEventArgs(_gameScore));

            BringCurrentShapeToNextOne();
            PlaceCurrentShape();
        }
Esempio n. 2
0
        private void EraseCompletedRows(List <int> completedRows)
        {
            for (int i = completedRows.Count - 1, offset = 0; i >= 0; i--)
            {
                for (var j = completedRows[i]; j > 0; j--)
                {
                    for (var k = 0; k < Model.GetLength(1); k++)
                    {
                        Model[j + offset, k] = Model[j + offset - 1, k];
                    }
                }

                offset++;
            }

            _gameScore += (completedRows.Count == 1) ? 10 : 15 * completedRows.Count;
            GameScoreChanged?.Invoke(this, new GameScoreEventArgs(_gameScore));
        }